home *** CD-ROM | disk | FTP | other *** search
- ' - Archive Utility for Red Ryder Host
- ' - Written by Pete Johnson
- ' - Glassell Park BBS (213) 258-7649
- ' - GEnie address PETERJ
- '
- ' - Thanks to John Alcock, Robert Lanza, Ed Edell, Patricia O'Connor,
- ' - Jon Haferman, Ray Terry, Otis Eversole, Greg Hulbert,
- ' - Dennis Cosio and Ralph Yount for their help and comments.
- '
- ' - Compiled in ZBasic version 5.0. To recompile,
- ' - turn on "Space required after key words" option
- ' - with the ZBasic Configure menu.
- '
- WINDOW OFF
- DIALOG OFF
- MOUSE OFF
- BREAK OFF
- MENU OFF
- TIMER OFF
- WIDTH -2
- FALSE = 0
- TRUE = NOT FALSE
- Registered = TRUE
- DEF LEN = 8
- Version$ = "1.62/"
- IF Registered THEN Version$ = Version$ + "F" ELSE Version$ = Version$ + "L"
- DEF LEN = 20
- When$ = "March 2, 1990"
- DEF LEN = 2
- CR$ = CHR$(13)
- EOL$ = CR$
- LF$ = CHR$(10)
- DEF LEN = 254
- APPLE MENU "About Archie ’89"
- MENU 1, 0, 1, "File"
- MENU 1, 1, 1, "/RReturn to Host"
- MENU 1, 2, 1, "/TTransfer…"
- MENU 1, 3, 0, ";"
- MENU 1, 4, 1, "Hang up without update"
- MENU 1, 5, 1, "/QQuit to Desktop"
- EDIT MENU 2
- MENU 3, 0, 1, "Sysop"
- MENU 3, 1, 1, "Break in for Chat"
- Temp$ = "Archie ’89 "+Version$+" by Pete Johnson"
- MENU 4, 0, 0, Temp$
- Temp$ = "From the late lamented Glassell Park BBS"
- MENU 4, 1, 0, Temp$
- Temp$ = "Written in ZBasic for Host 2.0 and beyond…"
- MENU 4, 2, 0, Temp$
- Volume$ = ""
- DEF LEN = 80
- WINDOW 1, "", (10, 30)-(502, 330), 2
- WINDOW 2, "", (7, 27)-(505, 50), 3
- WINDOW 3, "", (7, 50)-(505, 333), 3
- DEFSTR LONG
- DEF FN MakeStr$(Temp$) = MID$(Temp$, 2, ASC(LEFT$(Temp$,1)))
- DEF FN EncodeStr$(Temp$) = CHR$(LEN(Temp$)) + Temp$
- DEF FN MakeTime = (60 * VAL(MID$(Temp$, 4, 2))) + VAL(RIGHT$(Temp$, 2))
- DEF FN Short = (256 * ASC(MID$(Temp$, 1, 1))) + ASC(MID$(Temp$, 2, 1))
- DEF FN MakeShort$(Temp) = CHR$(Temp / 256) + CHR$(Temp MOD 256)
- ' Following function from August 1987 MacTutor article by Dave Kelly
- LONG FN ReturnString$(SHndl&)
- LengthByte% = PEEK(PEEK LONG(SHndl&))
- Resource$ = ""
- FOR Count% = 1 TO LengthByte%
- Resource$ = Resource$ + CHR$(PEEK(PEEK LONG(SHndl&) + Count%))
- NEXT Count%
- END FN = Resource$
- '
- ' Following are long variables
- ' Following variables are for menus -- allowing 75 lines per menu
- DEF LEN = 62
- DIM CmdType(75), TitleText$ (3), MenuText$(75)
- DEF LEN = 2
- DIM CmdKey$(75)
- DEF LEN = 42
- DIM CmdOpt$(75)
- ' And some non-string menu items...
- DIM CmdMod(75), CmdClr(75), Restrict&(75), CmdRMod(75)
- ' Next variable is for volume IDs for the directory routine
- DEF LEN = 120
- DIM Volume$(200)
- DIM UserLogLine$(4)
- DIM Upload$(26)
- ' Next variables are for Archie defaults
- DEF LEN = 60
- DIM Archie$(9)
- DIM ResName$(9)
- ' FOR ... NEXT loop loads resource names from DATA statements
- FOR Resource% = 130 TO 138
- READ ResName$(Resource%)
- NEXT Resource%
- ' Long default string length to avoid problems.
- DEF LEN = 160
- ' Text$() for log search command.
- DIM Text$(21)
- ' Create QEDit-compatible textfiles
- DEF OPEN = "TEXTQED1"
- ' Next two values check Carrier Detect on a Mac Plus (& others?)
- Modem = VAL("&H2CE")
- Hang = VAL("&H20")
- Device = 0
- NoShow = FALSE
- Local = FALSE
- Password = FALSE
- UserEdit = FALSE
- UserDelete = FALSE
- UploadFlag = FALSE
- ChatFlag = FALSE
- DEF LEN = 52
- NextQuitCont$ = "N>ext, Q>uit, C>ontinuous, RETURN = Next (N,Q,C)? "
- DEF LEN = 34
- Proceed$ = " <C to interrupt, S to pause>"
- DEF LEN = 28
- Continue$ = "Hit any key to continue... "
- DEF LEN = 20
- StandBy$ = "Please stand by..."
- DEF LEN = 26
- BeginFile$ = "<<< Beginning of file >>>"
- Continue1$ = "Hit any key to continue "
- DEF LEN = 24
- Exit$ = "Hit any key to exit... "
- DEF LEN = 20
- Dash$ = "--------------------"
- EndFile$ = "<<< End of file >>>"
- DEF LEN = 16
- Return$ = "<Return to quit>"
- Now$ = DATE$
- Now& = 365 * VAL(MID$(Now$, 7, 2)) + 30.5 * VAL(MID$(Now$, 1, 2)) + VAL(MID$(Now$, 4, 2))
- DEF LEN = 12
- Indent$ = " "
- LaunchFile$ = "LaunchRRH"
- DEF LEN = 76
- DIM FSec$(10)
- DIM Caller$(9)
- DEF LEN = 160
- '
- ' ------------- Main Program -------------
- '
- GOSUB "Get Archie Info"
- GOSUB "Host Status"
- ON ERROR GOSUB "Exit"
- ON MENU GOSUB "Menu Event"
- GOSUB "User Status"
- GOSUB "Refresh Window"
- IF Local THEN Device = 0 ELSE Device = Port
- IF NOT Local THEN OPEN "C", Port, Baud, 0, 0, 1, 8192
- IF LineFeed THEN EOL$ = CR$ + LF$
- MenuFile$ = ArchieMenu$
- "Main Loop"
- Interrupt = FALSE
- GOSUB "Echo LF"
- GOSUB "Read A Menu"
- SELECT Command
- CASE 2:MenuFile$ = Option$
- CASE 12:GOSUB "Text Display": REM Display text, Ctl-C cancel, paged
- CASE 13:GOSUB "Text Display": REM Display text, no cancel, paged
- CASE 14:GOSUB "Text Display": REM Display text, Ctl-C cancel
- CASE 87:IF Registered THEN GOSUB "File Search": REM Rapidly search all file sections for new
- CASE 88:IF Registered THEN GOSUB "File Search": REM Search all file sections for new
- CASE 89:IF Registered THEN GOSUB "File Search": REM Search all file sections for keyword
- CASE 90:GOSUB "Scavenge": REM Find inactive one-time callers
- CASE 91:GOSUB "Scavenge": REM Find inactive callers
- CASE 92:GOSUB "Search Log": REM Search part of logfile
- CASE 93:GOSUB "Analyze CLog": REM Analyze CallerLog
- CASE 94:GOSUB "Print File": REM Print a textfile, i.e. CallerLog
- CASE 95:GOSUB "Last Callers": REM List recent callers
- CASE 96:GOSUB "File Search": REM Search file sections by keyword
- CASE 97:GOSUB "Search String":REM Search for string, show one line
- CASE 98:GOSUB "Back UserLog": REM Backup UserLog
- CASE 99:GOSUB "Change Menu": REM Exit & run another menu
- CASE 100:GOSUB "Exit": REM Normal exit
- CASE 101:GOSUB "No Update": REM Wipe out LaunchRRH
- CASE 102:GOSUB "Exit": REM Shutdown
- CASE 103:GOSUB "Launch App": REM Run another program
- CASE 104:GOSUB "Kill File": REM Delete a file
- CASE 105:GOSUB "Reset": REM Reset file with datestamp
- CASE 106:GOSUB "Reset": REM Reset file no datestamp
- CASE 107:GOSUB "View": REM Read a log file from end
- CASE 108:GOSUB "Name List": REM Name/From list
- CASE 109:GOSUB "Name List": REM Name/From/Last Call list
- CASE 110:GOSUB "Count Users": REM Count UserLog entries
- CASE 111:GOSUB "Name Search": REM Full UserLog display
- CASE 112:GOSUB "Name Search": REM Like 111, but no password
- CASE 113:GOSUB "Name Search": REM Name/From/Call stats only
- CASE 114:GOSUB "Pre Validate": REM Validate user beforehand
- CASE 115:GOSUB "Find User": REM Non-stop UserLog display
- CASE 116:GOSUB "List Level": REM List users by access:
- CASE 117:GOSUB "List Time": REM List users by time:
- CASE 118:GOSUB "Location": REM List users by location/full
- CASE 119:GOSUB "Location": REM List users by location/brief
- CASE 120:GOSUB "List DL": REM List downloaders
- CASE 121:GOSUB "Credit Check": REM Analyze user contributions
- CASE 122:GOSUB "Search Log": REM Reverse look for string
- CASE 123:GOSUB "Alter Default":REM Change user analysis values
- CASE 124:GOSUB "Desktop": REM Exit Archie to Desktop
- CASE 125:GOSUB "Archie Info": REM About Archie...
- CASE 126:GOSUB "Search Log": REM Look for string in logfile
- CASE 127:GOSUB "Directory": REM Show directory of volumes
- CASE 128:GOSUB "Clear SYSMSG": REM Clear Systemx.msg read flags
- CASE 129:GOSUB "RestrictFlags":REM Set/clear user restriction flags
- CASE 130:GOSUB "Zero Log": REM Empty out logfile
- CASE 131:GOSUB "Clear Log": REM Clear out logfile prior to today
- CASE 132:GOSUB "Clear&Arc Log":REM Clear out logfile prior to today
- CASE 133:GOSUB "Clear MsgComb":REM Clear combined message read selection
- END SELECT
- LONG IF Execute
- GOSUB "Echo LF"
- GOSUB "Echo LF"
- Temp$ = " Do it again (Y,N)? "
- GOSUB "Noline Echo"
- GOSUB "Get Reply"
- IF Reply$ <> "Y" THEN "Back to Host"
- END IF
- GOTO "Main Loop"
- '
- ' ------------- Refresh Window -------------
- "Refresh Window"
- WINDOW #2
- PICTURE ON
- PRINT " ";Baud$;" ";ArchCaller$;" from ";FN MakeStr$(From$)
- PRINT " Clearance:";ArchClearance;
- PRINT " Time Limit:";ArchTime;
- Temp$ = NoCalls$
- PRINT " Times On:";FN Short;
- PICTURE OFF, Pic1&
- PICTURE, Pic1&
- WINDOW PICTURE #2, Pic1&
- WINDOW #3
- RETURN
- '
- ' ------------- Text Display -------------
- "Text Display"
- Page = 0
- GOSUB "Write to CallerLog"
- OPEN "I", 1, Option$, 1
- LONG IF Command <> 13
- GOSUB "Echo LF"
- Temp$ = Proceed$
- GOSUB "Newline Echo"
- END IF
- GOSUB "Echo LF"
- WHILE (NOT EOF(1)) AND (NOT Interrupt)
- READ #1, Temp$;1
- LONG IF Temp$ <> CR$
- GOSUB "Noline Echo"
- XELSE
- GOSUB "Echo LF"
- LONG IF Command <> 14
- Page = Page +1
- LONG IF Page = 24
- Page = 0
- GOSUB "Hit Key to Continue"
- GOSUB "Echo LF"
- END IF
- END IF
- END IF
- GOSUB "Check Modem"
- IF Command <> 13 THEN GOSUB "Check Interrupt"
- WEND
- CLOSE #1
- GOSUB "Echo LF"
- GOSUB "Hit Key to Continue"
- RETURN
- '
- ' ------------- Write to CallerLog -------------
- "Write to CallerLog"
- LONG IF ArchieLocal = FALSE
- LONG IF Command <> 103
- Temp$ = "Read text file"
- XELSE
- Temp$ = "Launching external application"
- END IF
- Temp$ = Temp$ + " <" + Option$ + ">"
- LONG IF CallerLog
- OPEN "A", 2, CallerLog$
- PRINT #2, Temp$
- CLOSE #2
- XELSE
- LONG IF PrintCallerLog
- OPEN "C", PPort, 9600
- HANDSHAKE PPort, -1
- PRINT #PPort, Temp$
- CLOSE #PPort
- END IF
- END IF
- END IF
- RETURN
- '
- ' ------------- Reset Files -------------
- "Reset"
- Temp$ = Option$ + ".Arch"
- OPEN "I", 1, Option$, 1
- OPEN "A", 2, Temp$, 1
- MarkPlace1& = 0
- MarkPlace2& = LOF(2,1)
- WHILE NOT EOF(1)
- RECORD #1, MarkPlace1&
- LINE INPUT#1, Temp$
- MarkPlace1& = REC(1)
- RECORD #2, MarkPlace2&
- PRINT #2, Temp$
- MarkPlace2& = REC(2)
- WEND
- CLOSE #1
- CLOSE #2
- LONG IF MarkPlace1& > 0
- OPEN "O", 1, Option$
- LONG IF Command = 105
- PRINT #1, "Started ";DATE$;" at ";LEFT$(TIME$, 5)
- PRINT #1, Dash$
- END IF
- CLOSE #1
- END IF
- GOSUB "Echo LF"
- Temp$ = Option$
- GOSUB "Path Finder"
- Temp$ = FName$+" has been reset."
- GOSUB "Newline Echo"
- GOSUB "Hit Key to Continue"
- RETURN
- '
- ' ------------- Zero Log -------------
- "Zero Log"
- OPEN "O", 1, Option$
- CLOSE #1
- Temp$ = Option$
- GOSUB "Path Finder"
- Temp$ = FName$+" has been zeroed."
- GOSUB "Newline Echo"
- GOSUB "Hit Key to Continue"
- RETURN
- '
- ' ------------- Clear Log -------------
- "Clear Log"
- '
- Today$ = DATE$
- OPEN "I", 1, Option$
- Temp$ = Option$ + ".$$$"
- OPEN "O", 2, Temp$
- WHILE NOT EOF(1)
- LINE INPUT #1, Temp$
- IF INSTR(1, Temp$, Today$) <> 0 THEN PRINT #2, Temp$
- WEND
- CLOSE #1
- CLOSE #2
- KILL Option$
- Temp$ = Option$ + ".$$$"
- RENAME Temp$ TO Option$
- Temp$ = Option$
- GOSUB "Path Finder"
- Temp$ = FName$+" has been cleared."
- GOSUB "Newline Echo"
- GOSUB "Hit Key to Continue"
- RETURN
- '
- ' ------------- Clear&Arc Log -------------
- "Clear&Arc Log"
- '
- Today$ = DATE$
- OPEN "I", 1, Option$
- Temp$ = Option$ + ".$$$"
- OPEN "O", 2, Temp$
- Temp$ = Option$ + ".Arch"
- OPEN "A", 3, Temp$
- WHILE NOT EOF(1)
- LINE INPUT #1, Temp$
- LONG IF INSTR(1, Temp$, Today$) <> 0
- PRINT #2, Temp$
- XELSE
- PRINT #3, Temp$
- END IF
- WEND
- CLOSE #1
- CLOSE #2
- CLOSE #3
- KILL Option$
- Temp$ = Option$ + ".$$$"
- RENAME Temp$ TO Option$
- Temp$ = Option$
- GOSUB "Path Finder"
- Temp$ = FName$+" has been cleared and archived."
- GOSUB "Newline Echo"
- GOSUB "Hit Key to Continue"
- RETURN
- '
- ' ------------- Clear MsgComb -------------
- "Clear MsgComb"
- '
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Temp$ = "This command clears message combined read flags in the UserLog so"
- GOSUB "Newline Echo"
- Temp$ = "callers will be asked to re-select combined message read sections."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "Are you sure you want to clear message combined read flags? "
- GOSUB "Noline Echo"
- GOSUB "Get Reply"
- IF Reply$ <> CR$ THEN GOSUB "Echo LF"
- IF LEFT$(Reply$, 1) <> "Y" THEN "Escape Clear MsgComb"
- GOSUB "Echo LF"
- Temp$ = StandBy$
- GOSUB "Newline Echo"
- Temp$ = STRING$(32, 0)
- OPEN "R", 1, UserLog$, 136
- Location = 0
- Limit = LOF(1, 136)
- WHILE (Location < Limit) AND (NOT Interrupt)
- RECORD #1, Location, 104
- WRITE #1, Temp$;32
- Location = Location + 1
- WEND
- CLOSE #1
- END IF
- "Escape Clear MsgComb"
- GOSUB "Hit Key to Continue"
- RETURN
- '
- ' ------------- Print File -------------
- "Print File"
- SEGMENT
- Temp$ = Option$
- GOSUB "Path Finder"
- IF Port = -2 THEN PPort = -1 ELSE PPort = -2
- OPEN "C", PPort, 9600
- HANDSHAKE PPort, -1
- OPEN "I", 1, Option$, 1
- Count = 0
- Page = 1
- TimeStamp$ = DATE$ + " " + TIME$
- WHILE NOT EOF(1)
- LONG IF Count = 0
- PRINT #PPort, Indent$;FName$;Indent$;TimeStamp$;Indent$;"Page";Page;LF$
- PRINT #PPort, LF$
- Page = Page + 1
- END IF
- LINE INPUT#1, Temp$
- WHILE LEN(Temp$) > 72
- Temp1$ = LEFT$(Temp$, 72)
- PRINT #PPort, Indent$;Temp1$;LF$
- Count = Count + 1
- IF Count = 59 THEN GOSUB "New Page"
- Temp$ = " " + RIGHT$(Temp$, LEN(Temp$) - 72)
- WEND
- PRINT #PPort, Indent$;Temp$;LF$
- Count = Count + 1
- IF Count = 59 THEN GOSUB "New Page"
- WEND
- LONG IF Count > 0
- FOR I = Count TO 64
- PRINT #PPort, LF$
- NEXT I
- END IF
- CLOSE #PPort
- CLOSE #1
- SEGMENT RETURN
- '
- ' ------------- New Page -------------
- "New Page"
- FOR I = 1 TO 5
- PRINT #PPort, LF$
- NEXT I
- Count = 0
- RETURN
- '
- ' ------------- Choose Viewing Time -------------
- "View"
- GOSUB "Echo LF"
- Temp$ = "Enter a number for how many minutes you want to view the"
- GOSUB "Newline Echo"
- Temp$ = "file. Type a number (decimals are OK) and hit Return."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "Time? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF Reply$ = "" THEN "Leave View"
- Reply! = VAL(Reply$)
- IF Reply! = 0 THEN "View"
- AttSpan& = Reply! * Baud * 6
- GOSUB "Write to CallerLog"
- OPEN "I", 1, Option$, 1
- FLength& = LOF (1,1)
- IF FLength& <= AttSpan& THEN FPointer& = 0:Big = FALSE
- IF FLength& > AttSpan& THEN FPointer& = FLength& - AttSpan&:Big = TRUE
- RECORD 1, FPointer&
- LONG IF FLength& > 1
- Temp$ = Proceed$
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- LONG IF Big
- WHILE (NOT EOF(1)) AND (Temp$ <> CR$)
- READ #1, Temp$;1
- WEND
- END IF
- WHILE (NOT EOF(1)) AND (NOT Interrupt)
- READ #1, Temp$;1
- LONG IF Temp$ <> CR$
- GOSUB "Noline Echo"
- XELSE
- GOSUB "Echo LF"
- END IF
- GOSUB "Check Modem"
- GOSUB "Check Interrupt"
- WEND
- XELSE
- Temp$ = "File has just been reset!"
- GOSUB "Newline Echo"
- END IF
- CLOSE #1
- GOSUB "Hit Key to Continue"
- "Leave View"
- RETURN
- '
- ' ------------- Count Users -------------
- "Count Users"
- OPEN "I", 1, UserLog$, 136
- Temp = LOF(1, 136)
- CLOSE #1
- GOSUB "Echo LF"
- Temp$ = "There are "
- GOSUB "Noline Echo"
- IF Temp < 10 THEN Place% = 1:GOSUB "Format Number"
- IF Temp > 9 THEN IF Temp < 100 THEN Place% = 2:GOSUB "Format Number"
- IF Temp > 99 THEN IF Temp < 1000 THEN Place% = 3:GOSUB "Format Number"
- IF Temp > 999 THEN Place% = 4:GOSUB "Format Number"
- Temp$ = Temp$ + " callers in the UserLog."
- GOSUB "Newline Echo"
- GOSUB "Hit Key to Continue"
- RETURN
- '
- ' ------------- Name Search -------------
- "Name Search"
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Temp$ = "Enter all or part of name to find: "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- GOSUB "Echo LF"
- IF Reply$ <> "" THEN GOSUB "Find User"
- END IF
- RETURN
- '
- ' ------------- Name List -------------
- "Name List"
- ' This command duplicates Host command 7, but adds last call info
- OPEN "I", 1, UserLog$, 136
- Count1% = 1
- GOSUB "Echo LF"
- WHILE (NOT EOF(1)) AND (NOT Interrupt)
- GOSUB "Read UserLog Entry"
- UserLogLine$(1) = Caller$+" from "
- Temp$ = FN MakeStr$(From$)
- LONG IF Command = 109
- UserLogLine$(1) = UserLogLine$(1) + Temp$ + " last called "
- Place% = 2
- FOR Count% = 2 TO 3
- Temp$ = MID$(LastCall$, Count%, 1)
- Temp = ASC(Temp$)
- GOSUB "Format Number"
- UserLogLine$(1) = UserLogLine$(1) + Temp$ + "/"
- NEXT Count%
- Temp$ = MID$(LastCall$, 1, 1)
- Temp = ASC(Temp$)
- GOSUB "Format Number"
- END IF
- Temp$ = UserLogLine$(1) + Temp$
- GOSUB "Newline Echo"
- Count1% = Count1% + 1
- LONG IF Count1% = 24
- Count1% = 1
- "Any Input?"
- Temp$ = " Continue (Y,N)? "
- GOSUB "Noline Echo"
- GOSUB "Get Reply"
- IF Reply$ <> CR$ THEN GOSUB "Echo LF"
- IF Reply$ = "N" THEN "Later For You"
- LONG IF Reply$ <> "Y"
- GOSUB "Echo LF"
- GOTO "Any Input?"
- END IF
- END IF
- GOSUB "Check Interrupt"
- WEND
- "Later For You"
- CLOSE #1
- RETURN
- '
- ' ------------- Access Level Search -------------
- "List Level"
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Temp$ = "Enter user access level to list: "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- Reply = VAL(Reply$)
- LONG IF Reply > -1
- Temp$ = "Include access levels <E>qual, <G>reater or <L>ess (E,G,L)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Key"
- Relate$ = UCASE$(Hit$)
- IF ((Relate$ <> "G") AND (Relate$ <> "L")) THEN Relate$ = "E"
- GOSUB "Echo LF"
- GOSUB "Echo LF"
- GOSUB "Find User"
- END IF
- END IF
- RETURN
- ' ------------- Time Search -------------
- "List Time"
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Temp$ = "Enter user time limit to list: "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- Reply = VAL(Reply$)
- LONG IF Reply <> 0
- Temp$ = "Include times <E>qual, <G>reater or <L>ess (E,G,L)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Key"
- Relate$ = UCASE$(Hit$)
- IF ((Relate$ <> "G") AND (Relate$ <> "L")) THEN Relate$ = "E"
- GOSUB "Echo LF"
- GOSUB "Echo LF"
- GOSUB "Find User"
- END IF
- END IF
- RETURN
- ' ------------- Location Search -------------
- "Location"
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Temp$ = "Enter all or part of location to find: "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- GOSUB "Echo LF"
- IF Reply$ <> "" THEN GOSUB "Find User"
- END IF
- RETURN
- '
- ' ------------- List Downloaders -------------
- "List DL"
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Temp$ = "Downloaders will be shown on the basis of three figures:"
- GOSUB "Newline Echo"
- Temp$ = "Number of downloads, uploads and public messages."
- GOSUB "Newline Echo"
- Temp$ = "Archie will display callers who have downloaded "+CheckDL$+" files"
- GOSUB "Newline Echo"
- Temp$ = "and who have uploaded fewer than "+CheckUL$+" files and who have posted"
- GOSUB "Newline Echo"
- Temp$ = "fewer than "+CheckMsg$+" messages."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- GOSUB "Find User"
- END IF
- RETURN
- '
- ' ------------- UserLog Credit Check -------------
- "Credit Check"
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Temp$ = STR$(DLValue)
- Temp$ = "The UserLog will be scanned using a formula of"+Temp$+" downloads"
- GOSUB "Newline Echo"
- Temp$ = STR$(MsgValue!)
- Temp$ = "allowed per upload and"+Temp$+" messages equal to one upload."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "Do you want to see Givers or Takers (G,T)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Key"
- Analyze$ = UCASE$(Hit$)
- GOSUB "Echo LF"
- GOSUB "Echo LF"
- LONG IF (Analyze$ = "G" OR Analyze$ = "T")
- Temp$ = "Choose a percentage as a guide (100 is a 'balanced' percentage): "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF Reply$ = "" THEN Merit! = 100 ELSE Merit! = VAL(Reply$)
- GOSUB "Echo LF"
- GOSUB "Find User"
- END IF
- END IF
- RETURN
- '
- ' ------------- Find inactive users -------------
- "Scavenge"
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Temp$ = "Archie will search the Userlog for inactive callers. You will"
- GOSUB "Newline Echo"
- Temp$ = "see callers who have not called back for the period of time you"
- GOSUB "Newline Echo"
- Temp$ = "specify."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "How many days since the last call? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- Inactive = VAL(Reply$)
- IF Inactive <> 0 THEN GOSUB "Find User"
- END IF
- RETURN
- '
- ' ------------- Find User -------------
- "Find User"
- SEGMENT
- Target$ = UCASE$(Reply$)
- UserFound = FALSE
- OPEN "I", 1, UserLog$, 136
- RECORD #1, 0
- WHILE (NOT EOF(1)) AND (NOT Interrupt)
- GOSUB "Read UserLog Entry"
- LONG IF Command => 111 AND Command =< 113
- IF (Command = 111) THEN UserEdit = TRUE
- IF INSTR(1, UCASE$(Caller$), Target$) THEN "Display User Entry"
- END IF
- LONG IF (Command = 90) OR (Command = 91)
- UserDelete = TRUE
- LastCall& = 365 * ASC(LEFT$(LastCall$, 1)) + 30.5 * ASC(MID$(LastCall$, 2, 1)) + ASC(MID$(LastCall$, 3, 1))
- Temp = Now& - LastCall&
- LONG IF Temp > Inactive
- IF (NoCalls = 1) AND (Command = 90) THEN "Display User Entry"
- IF (Command = 91) THEN "Display User Entry"
- END IF
- END IF
- IF Command = 115 THEN GOSUB "Echo LF":GOTO "Display User Entry"
- LONG IF Command = 116
- UserEdit = TRUE
- IF Relate$ = "E" THEN IF Reply = Clearance THEN "Display User Entry"
- IF Relate$ = "G" THEN IF Reply =< Clearance THEN "Display User Entry"
- IF Relate$ = "L" THEN IF Reply => Clearance THEN "Display User Entry"
- END IF
- LONG IF Command = 117
- UserEdit = TRUE
- IF Relate$ = "E" THEN IF Reply = Time THEN "Display User Entry"
- IF Relate$ = "G" THEN IF Reply =< Time THEN "Display User Entry"
- IF Relate$ = "L" THEN IF Reply => Time THEN "Display User Entry"
- END IF
- LONG IF (Command = 118) OR (Command = 119)
- Temp$ = FN MakeStr$(From$)
- IF INSTR(1, UCASE$(Temp$), UCASE$(Reply$)) THEN "Display User Entry"
- END IF
- LONG IF Command = 120
- UserEdit = TRUE
- LONG IF DL => CheckDL
- LONG IF UL < CheckUL
- IF Pub < CheckMsg THEN "Display User Entry"
- END IF
- END IF
- END IF
- LONG IF (Command = 121) AND (NoCalls > NewCall) AND (Clearance < Privilege)
- UserEdit = TRUE
- Credit! = (UL * MsgValue!) + Pub
- Credit! = Credit! * DLValue
- Credit! = Credit!\MsgValue!
- Debit! = DL
- LONG IF Debit! = 0
- Debit! = 0.1
- IF Credit! > 320 THEN Credit! = 320
- END IF
- Credit! = Credit!\Debit!
- Credit! = 100 * Credit!
- Credit! = INT(Credit!)
- Temp$ = STR$(Credit!)
- Credit$ = "Credit Rating is" + Temp$ + "%"
- IF (Analyze$ = "G") AND (Credit! => Merit!) THEN "Display User Entry"
- IF (Analyze$ = "T") AND (Credit! =< Merit!) AND (DL > 0) THEN "Display User Entry"
- END IF
- GOTO "Jump Next"
- "Display User Entry"
- UserFound = TRUE
- UserLogLine$(1) = "Name: "+Caller$+" From: "
- Temp$ = FN MakeStr$(From$)
- UserLogLine$(1) = UserLogLine$(1) + Temp$
- LONG IF ((Command <> 113) AND (Command <> 119))
- IF ((ASC(Flag$) AND 64) = 64) THEN Temp$ = " [Deleted]" ELSE Temp$ = ""
- XELSE
- Temp$ = ""
- END IF
- UserLogLine$(1) = UserLogLine$(1) + Temp$
- LONG IF Command = 111
- Temp$ = FN MakeStr$(PW$)
- UserLogLine$(2) = "Pwd: " + Temp$ + " "
- XELSE
- UserLogLine$(2) = ""
- END IF
- UserLogLine$(2) = UserLogLine$(2) + "Calls: "
- Temp = NoCalls
- Place% = 4
- GOSUB "Format Number"
- UserLogLine$(2) = UserLogLine$(2) + Temp$ + " Last Call: "
- Place% = 2
- FOR Count% = 2 TO 3
- Temp$ = MID$(LastCall$, Count%, 1)
- Temp = ASC(Temp$)
- GOSUB "Format Number"
- UserLogLine$(2) = UserLogLine$(2) + Temp$ + "/"
- NEXT Count%
- Temp$ = MID$(LastCall$, 1, 1)
- Temp = ASC(Temp$)
- GOSUB "Format Number"
- UserLogLine$(2) = UserLogLine$(2) + Temp$
- LONG IF ((Command <> 113) AND (Command <> 119))
- UserLogLine$(2) = UserLogLine$(2) + " Time: "
- Temp = Time
- Place% = 3
- GOSUB "Format Number"
- UserLogLine$(2) = UserLogLine$(2) + Temp$ + " Clearance: "
- Temp = Clearance
- Place% = 3
- GOSUB "Format Number"
- UserLogLine$(2) = UserLogLine$(2) + Temp$
- LONG IF ((Command <> 113) AND (Command <> 119))
- GOSUB "Display Restriction"
- UserLogLine$(3) = Temp$
- END IF
- Temp = UL
- Place% = 4
- GOSUB "Format Number"
- UserLogLine$(4) = "Uploads: " + Temp$ + " Downloads: "
- Temp = DL
- GOSUB "Format Number"
- UserLogLine$(4) = UserLogLine$(4) + Temp$ + " Priv Msg: "
- Temp = Priv
- GOSUB "Format Number"
- UserLogLine$(4) = UserLogLine$(4) + Temp$ + " Pub Msg: "
- Temp = Pub
- GOSUB "Format Number"
- UserLogLine$(4) = UserLogLine$(4) + Temp$
- END IF
- '
- IF ((Command = 113) OR (Command = 119)) THEN Bound = 2 ELSE Bound = 4
- FOR Count% = 1 TO Bound
- Limit% = LEN(UserLogLine$(Count%))
- FOR Count2% = 1 TO Limit%
- Temp$ = MID$(UserLogLine$(Count%), Count2%, 1)
- GOSUB "Noline Echo"
- GOSUB "Check Modem"
- IF NOT Interrupt THEN GOSUB "Check Interrupt"
- IF Interrupt THEN Count2% = Limit%
- NEXT Count2%
- GOSUB "Echo LF"
- IF Interrupt THEN Count% = Bound
- NEXT Count%
- LONG IF (Command = 121) AND (NOT Interrupt)
- Temp$ = Credit$
- GOSUB "Newline Echo"
- END IF
- GOSUB "Echo LF"
- IF NonStop THEN "Jump Next"
- LONG IF (UserEdit OR UserDelete) AND (MyClearance > Clearance) AND (NOT Interrupt)
- Temp$ = Continue1$ + "(E>dit, D>elete, C>ancel, N>onstop): "
- XELSE
- Temp$ = Continue1$ + "(C>ancel, N>onstop): "
- END IF
- GOSUB "Noline Echo"
- GOSUB "Get A Key"
- Check$ = UCASE$(Hit$)
- IF Check$ <> CR$ THEN GOSUB "Echo LF"
- GOSUB "Echo LF"
- LONG IF (UserEdit OR UserDelete) AND (MyClearance > Clearance) AND ((Check$ = "E") OR (Check$ = "D"))
- PlaceMark = REC(1)
- PlaceMark = PlaceMark - 1
- CLOSE #1
- IF Check$ = "D" THEN "Edit Delete Status"
- Temp$ = STR$(Time)
- Temp$ = MID$(Temp$, 2, LEN(Temp$) - 1)
- Temp$ = "Old time limit = " + Temp$ + ". New time limit (1-255)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- Temp = VAL(Reply$)
- IF (Temp < 1) OR (Temp > 255) OR (Reply$ = "") THEN "Edit Clearance"
- Temp$ = CHR$(Temp)
- OPEN "R", 1, UserLog$, 136
- RECORD #1, PlaceMark, 80
- WRITE #1, Temp$;1
- CLOSE #1
- "Edit Clearance"
- Temp$ = STR$(Clearance)
- Temp$ = MID$(Temp$, 2, LEN(Temp$) - 1)
- Temp$ = "Old clearance is " + Temp$ + ". New clearance level (0-255)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- Temp = VAL(Reply$)
- LONG IF Temp > 250
- Temp$ = "Sorry: you cannot enter a clearance level higher than 250."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- GOTO "Edit Clearance"
- END IF
- LONG IF Temp > ArchClearance
- Temp$ = "Sorry: you cannot enter a clearance level higher than your own."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- GOTO "Edit Clearance"
- END IF
- IF (Temp < 0) OR (Temp > 255) OR (Reply$ = "") THEN "Edit Restrictions"
- Temp$ = CHR$(Temp)
- OPEN "R", 1, UserLog$, 136
- RECORD #1, PlaceMark, 81
- WRITE #1, Temp$;1
- CLOSE #1
- "Edit Restrictions"
- GOSUB "Display Restriction"
- GOSUB "Newline Echo"
- Temp$ = "Flag to alter (1-24, Return to quit)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- GOSUB "Echo LF"
- FlagNo = VAL(Reply$)
- FlagNo = FlagNo - 1
- LONG IF (FlagNo => 0) AND (FlagNo =< 23)
- ' find out which of the three bytes to alter
- ' (bytes are in reverse order: 99, 98, 97)
- Offset = 99 - (FlagNo / 8)
- ' find out which bit to alter
- Temp1 = (FlagNo MOD 8)
- FlagNo = 2^Temp1
- OPEN "R", 1, UserLog$, 136
- Position = 0
- RECORD #1, PlaceMark, Offset
- READ #1, Flag$;1
- Flag$ = CHR$(ASC(Flag$) XOR FlagNo)
- RECORD #1, PlaceMark, Offset
- WRITE #1, Flag$;1
- RECORD #1, PlaceMark, 97
- READ #1, Restriction$;3
- CLOSE #1
- GOTO "Edit Restrictions"
- END IF
- "Edit Delete Status"
- Flag = ASC(Flag$)
- Temp$ = "Delete user (Y,N)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Key"
- GOSUB "Echo LF"
- IF Hit$ <> CR$ THEN GOSUB "Echo LF"
- Temp$ = UCASE$(Hit$)
- IF Temp$ = "Y" THEN Flag = (Flag OR 64) ELSE Flag = (Flag AND 191)
- Flag$ = CHR$(Flag)
- OPEN "R", 1, UserLog$, 136
- RECORD #1, PlaceMark, 85
- WRITE #1, Flag$;1
- CLOSE #1
- "Skip Edit"
- PlaceMark = PlaceMark + 1
- OPEN "I", 1, UserLog$, 136
- RECORD #1, PlaceMark
- GOTO "Jump Next"
- END IF
- IF Check$ = "C" THEN Interrupt = TRUE
- LONG IF Check$ = "N"
- NonStop = TRUE
- Temp$ = Proceed$
- GOSUB "Newline Echo"
- XELSE
- NonStop = FALSE
- END IF
- GOSUB "Echo LF"
- "Jump Next"
- GOSUB "Check Modem"
- IF NOT Interrupt THEN GOSUB "Check Interrupt"
- WEND
- CLOSE #1
- LONG IF (UserFound = FALSE) AND (NOT Interrupt)
- Temp$ = "No matches found."
- GOSUB "Newline Echo"
- END IF
- NonStop = FALSE
- UserEdit = FALSE
- UserDelete = FALSE
- GOSUB "Hit Key to Continue"
- SEGMENT RETURN
- '
- ' ------------- Format Number -------------
- ' Next routine converts number into string, lops off leading &
- ' trailing spaces and pads left of number with spaces.
- "Format Number"
- Temp$ = STR$(Temp)
- NewText$ = ""
- FOR Format% = 1 TO LEN(Temp$)
- Text$ = MID$(Temp$, Format%, 1)
- IF Text$ <> " " THEN NewText$ = NewText$ + Text$
- NEXT Format%
- Temp$ = NewText$
- WHILE LEN(Temp$) < Place%
- Temp$ = " " + Temp$
- WEND
- RETURN
- '
- ' ------------- Display Restriction -------------
- "Display Restriction"
- ' Displays restriction flags.
- Temp$ = Restriction$
- GOSUB "Decode Restriction"
- Temp$ = ""
- FOR FlagsCount% = 23 TO 0 STEP -1
- Divisor& = 2 ^FlagsCount%
- LONG IF (Temp& / Divisor& = 1)
- Temp$ = "X" + Temp$
- Temp& = Temp& - Divisor&
- XELSE
- Temp$ = "0" + Temp$
- END IF
- IF (FlagsCount% > 0) AND (FlagsCount% MOD 4) = 0 THEN Temp$ = " " + Temp$
- NEXT FlagsCount%
- Temp$ = "Restriction Flags 1-24 (0=Clear, X=Set): " + Temp$
- RETURN
- '
- ' ------------- Pre Validate -------------
- SEGMENT
- "Pre Validate"
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Temp$ = "First name of caller (15 characters max)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF Reply$ = "" THEN "Leave Pre Validate"
- LONG IF LEN(Reply$) > 15
- Temp$ = "Too long!"
- GOSUB "Newline Echo"
- GOTO "Pre Validate"
- END IF
- FirstName$ = FN EncodeStr$(Reply$)
- IF LEN(FirstName$) < 16 THEN FirstName$ = FirstName$ + STRING$(16 - LEN(FirstName$), 0)
- "Last Name"
- Temp$ = "Last name of caller (15 characters max)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF Reply$ = "" THEN "Leave Pre Validate"
- LONG IF LEN(Reply$) > 15
- Temp$ = "Too long!"
- GOSUB "Newline Echo"
- GOTO "Last Name"
- END IF
- LastName$ = FN EncodeStr$(Reply$)
- IF LEN(LastName$) < 16 THEN LastName$ = LastName$ + STRING$(16 - LEN(LastName$), 0)
- "Calling From"
- Temp$ = "Calling from (30 characters max)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF Reply$ = "" THEN "Leave Pre Validate"
- LONG IF LEN(Reply$) > 30
- Temp$ = "Too long!"
- GOSUB "Newline Echo"
- GOTO "Calling From"
- END IF
- From$ = FN EncodeStr$(Reply$)
- IF LEN(From$) < 31 THEN From$ = From$ + STRING$(31 - LEN(From$), 0)
- "Password"
- Temp$ = "Password (8 characters max)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF Reply$ = "" THEN "Leave Pre Validate"
- LONG IF LEN(Reply$) > 15
- Temp$ = "Too long!"
- GOSUB "Newline Echo"
- GOTO "Password"
- END IF
- Password$ = FN EncodeStr$(Reply$)
- IF LEN(Password$) < 9 THEN Password$ = Password$ + STRING$(9 - LEN(Password$), 0)
- "Time Limit"
- Temp$ = "Time limit (0-255)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF Reply$ = "" THEN "Leave Pre Validate"
- Reply = VAL(Reply$)
- LONG IF Reply > 255
- Temp$ = "Too long!"
- GOSUB "Newline Echo"
- GOTO "Time Limit"
- END IF
- Time$ = CHR$(Reply)
- "Clearance Level"
- Temp$ = "Clearance level (0-250)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF Reply$ = "" THEN "Leave Pre Validate"
- Reply = VAL(Reply$)
- LONG IF Reply > 250
- Temp$ = "That's too high!"
- GOSUB "Newline Echo"
- GOTO "Clearance Level"
- END IF
- LONG IF Reply > ArchClearance
- Temp$ = "Sorry: you cannot enter an access level higher than your own."
- GOSUB "Newline Echo"
- GOTO "Clearance Level"
- END IF
- Clearance$ = CHR$(Reply)
- Temp$ = "One moment, please..."
- GOSUB "Newline Echo"
- OPEN "A", 1, UserLog$, 136, V%
- PRINT #1, FirstName$;LastName$;From$;Password$;
- ' next loop writes zeroes in # of calls and date/time of last call
- FOR Count = 1 TO 8
- PRINT #1, CHR$(0);
- NEXT Count
- PRINT #1, Time$;Clearance$;
- ' next loop writes zeroes in minutes of last call and two reserved bytes
- FOR Count = 1 TO 3
- PRINT #1, CHR$(0);
- NEXT Count
- ' set user flag to CRs only and never clear screen
- PRINT #1, CHR$(129);
- ' next loop writes zeroes in remainder of user record
- FOR Count = 1 TO 50
- PRINT #1, CHR$(0);
- NEXT Count
- CLOSE #1
- "Leave Pre Validate"
- END IF
- SEGMENT RETURN
- '
- ' ------------- Search Log -------------
- "Search Log"
- SEGMENT
- GOSUB "Echo LF"
- Temp$ = Option$
- GOSUB "Path Finder"
- Temp$ = "This command searches "+FName$+" for a string you specify. Caps"
- GOSUB "Newline Echo"
- Temp$ = "and lower case don't matter. If a match is found, 21 lines are"
- GOSUB "Newline Echo"
- Temp$ = "displayed to show text before and after the match."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- "Search Loop 1"
- Temp$ = "String to find " + Return$ + "? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF Reply$ = "" THEN "Leave Search Log"
- GOSUB "Echo LF"
- LookFor$ = Reply$
- MarkPlace1& = 0
- StringFound% = FALSE
- NoStringFound% = TRUE
- FirstRead% = TRUE
- OPEN "I", 1, Option$, 1, V%
- LONG IF Command = 92
- Temp$ = "If you want to search all of the file, enter 100, otherwise you"
- GOSUB "Newline Echo"
- Temp$ = "can scan only a percentage of the last part of the file."
- GOSUB "Newline Echo"
- Temp$ = "What percent of the file do you want to search (1-100)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF Reply$ = "" THEN CLOSE #1:GOTO "Leave Search Log"
- Temp! = VAL(Reply$) + 0.5
- IF Temp! < 1 THEN CLOSE #1:GOTO "Leave Search Log"
- GOSUB "Echo LF"
- LONG IF Temp! <= 100
- FileLength! = LOF(1)
- MarkPlace1& = FileLength! - ((Temp!\100.) * FileLength!)
- RECORD #1, MarkPlace1&
- WHILE (NOT EOF(1)) AND (Temp$ <> CR$)
- READ #1, Temp$;1
- WEND
- MarkPlace1& = REC(1)
- END IF
- END IF
- Temp$ = Proceed$
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- LONG IF Command = 122
- HoldPlace& = LOF(1,1) - 1
- Pointer = 21
- Text$(21) = EndFile$
- XELSE
- Pointer = 1
- Text$(1) = BeginFile$
- END IF
- "Search Loop 2"
- LONG IF Command = 122
- GOSUB "Search Backwards"
- GOTO "Next Stop"
- END IF
- WHILE (NOT EOF(1)) AND (NOT Interrupt) AND (NOT StringFound%)
- Count% = Pointer
- RECORD #1, MarkPlace1&
- GOSUB "Check Modem"
- Count% = Count% + 1
- IF Count% = 22 THEN Count% = 1
- LINE INPUT #1, Text$(Count%)
- MarkPlace1& = REC(1)
- Pointer = Count%
- IF Count% > 11 THEN FirstRead% = FALSE
- LONG IF INSTR(1, UCASE$(Text$(Count%)), LookFor$)
- LONG IF NOT FirstRead%
- BeginDisplay = Count% - 10
- XELSE
- BeginDisplay = 1
- END IF
- IF BeginDisplay < 1 THEN BeginDisplay = BeginDisplay + 21
- StringFound% = TRUE
- NoStringFound% = FALSE
- Temp = 1
- WHILE (NOT EOF(1)) AND (Temp < 11)
- Count% = Count% + 1
- IF Count% = 22 THEN Count% = 1
- LINE INPUT #1, Text$(Count%)
- Temp = Temp + 1
- WEND
- END IF
- GOSUB "Check Interrupt"
- WEND
- EndDisplay = Count%
- "Next Stop"
- GOSUB "Show 21 Lines"
- IF (Command = 122) AND (MarkPlace1& < 1) THEN Temp% = TRUE
- IF (Command <> 122) THEN Temp% = EOF(1)
- LONG IF (NOT Temp%) AND (NOT Interrupt)
- StringFound% = FALSE
- GOSUB "Echo LF"
- Temp$ = Continue1$ + Return$ + ": "
- GOSUB "Noline Echo"
- GOSUB "Get A Key"
- IF Hit$ <> CR$ THEN GOSUB "Echo LF"
- GOSUB "Echo LF"
- IF Command = 122 AND (MarkPlace1& < 0) THEN "Over The Top"
- IF (Hit$ <> CR$) THEN "Search Loop 2"
- "Over The Top"
- END IF
- CLOSE #1
- GOSUB "Echo LF"
- LONG IF NoStringFound% = TRUE AND NOT Interrupt
- Temp$ = "No matching string found."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- END IF
- IF NOT Interrupt THEN "Search Loop 1"
- GOSUB "Hit Key to Continue"
- "Leave Search Log"
- SEGMENT RETURN
- '
- ' ------------- Display Log Line -------------
- "Display Log Line"
- Limit% = LEN(Text$(Count%))
- LONG IF Limit%
- FOR Display% = 1 TO Limit%
- Temp$ = MID$(Text$(Count%), Display%, 1)
- GOSUB "Noline Echo"
- GOSUB "Check Interrupt"
- IF Interrupt THEN Display% = Limit%
- NEXT Display%
- END IF
- GOSUB "Echo LF"
- RETURN
- '
- ' ------------- Show 21 Lines -------------
- "Show 21 Lines"
- LONG IF StringFound% AND (NOT Interrupt)
- LONG IF Command = 122 AND (MarkPlace1& < 0)
- Temp$ = BeginFile$
- GOSUB "Newline Echo"
- END IF
- LONG IF BeginDisplay < EndDisplay
- FOR Count% = BeginDisplay TO EndDisplay
- GOSUB "Display Log Line"
- IF Interrupt THEN Count% = EndDisplay
- NEXT Count%
- XELSE
- FOR Count% = BeginDisplay TO 21
- GOSUB "Display Log Line"
- IF Interrupt THEN Count% = 21
- NEXT Count%
- LONG IF NOT Interrupt
- FOR Count% = 1 TO EndDisplay
- GOSUB "Display Log Line"
- IF Interrupt THEN Count% = EndDisplay
- NEXT Count%
- END IF
- END IF
- LONG IF EOF(1) AND (NOT Interrupt) AND (Command <> 122)
- Temp$ = EndFile$
- GOSUB "Newline Echo"
- END IF
- END IF
- RETURN
- '
- ' ------------- Search Backwards -------------
- "Search Backwards"
- MarkPlace1& = HoldPlace&
- WHILE (MarkPlace1& > -1) AND (NOT Interrupt) AND (NOT StringFound%)
- Count% = Pointer - 1
- IF Count% = 0 THEN Count% = 21
- GOSUB "Build a Line"
- Text$(Count%) = Temp$
- Pointer = Count%
- IF Count% < 11 THEN FirstRead% = FALSE
- LONG IF INSTR(1, UCASE$(Text$(Count%)), LookFor$)
- HoldPlace& = MarkPlace1&
- LONG IF NOT FirstRead%
- BeginDisplay = Count% - 10
- IF BeginDisplay < 1 THEN BeginDisplay = BeginDisplay + 21
- XELSE
- BeginDisplay = 1
- END IF
- StringFound% = TRUE
- NoStringFound% = FALSE
- Temp1 = 1
- WHILE (NOT EOF(1)) AND (Temp1 < 11)
- Count% = Count% - 1
- IF Count% = 0 THEN Count% = 21
- GOSUB "Build a Line"
- Text$(Count%) = Temp$
- Temp1 = Temp1 + 1
- WEND
- END IF
- GOSUB "Check Modem"
- GOSUB "Check Interrupt"
- WEND
- BeginDisplay = Count%
- LONG IF NOT FirstRead%
- EndDisplay = BeginDisplay - 1
- IF EndDisplay = 0 THEN EndDisplay = 21
- XELSE
- EndDisplay = 21
- END IF
- RETURN
- '
- ' ------------- Build a Line -------------
- "Build a Line"
- Temp$ = ""
- Temp1$ = ""
- WHILE (MarkPlace1& > -1)
- RECORD #1, MarkPlace1&
- READ #1, Temp1$;1
- MarkPlace1& = MarkPlace1& - 1
- IF (Temp1$ = CR$) THEN "Stop Building"
- Temp$ = Temp1$ + Temp$
- WEND
- "Stop Building"
- RETURN
- '
- ' ------------- Search for a String, Show One Line -------------
- "Search String"
- GOSUB "Echo LF"
- Temp$ = "String to find " + Return$ + "? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- GOSUB "Echo LF"
- LONG IF Reply$ <> ""
- LookFor$ = Reply$
- OPEN "I", 1, Option$
- Temp$ = Proceed$
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- WHILE (NOT EOF(1)) AND (NOT Interrupt)
- LINE INPUT #1, Temp$
- IF (INSTR(1, UCASE$(Temp$), LookFor$) > 0) GOSUB "Newline Echo"
- GOSUB "Check Interrupt"
- GOSUB "Check Modem"
- WEND
- CLOSE #1
- IF (NOT Interrupt) THEN GOSUB "Hit Key to Continue"
- END IF
- RETURN
- '
- ' ------------- File Search -------------
- SEGMENT
- "File Search"
- ON ERROR GOSUB "FSection Error"
- WhatsNew = 0
- LookFor$ = ""
- FirstTime = TRUE
- OneByOne = TRUE
- GOSUB "Echo LF"
- LONG IF (Command = 89) OR (Command = 96)
- Temp$ = "String to find " + Return$ + "? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- GOSUB "Echo LF"
- IF (Reply$ = "") THEN "Exit File Search"
- LookFor$ = Reply$
- XELSE: REM Command = 87 or 88
- MDY$ = DATE$
- GOSUB "Decode Date String"
- GOSUB "Count the Days"
- NowaDays& = Day% + (Year% * 365.25)
- Temp$ = "Look at files: N>ew since last call, R>ecently uploaded (N,R)? "
- GOSUB "Noline Echo"
- GOSUB "Get Reply"
- GOSUB "Echo LF"
- GOSUB "Echo LF"
- LONG IF Reply$ = "N"
- WhatsNew = 1 + NowaDays& - ArchLastCall&
- LONG IF (WhatsNew > 182)
- GOSUB "Echo LF"
- Temp$ = "Your last call was too long ago!"
- GOSUB "Newline Echo"
- GOTO "Exit File Search"
- END IF
- XELSE: REM User chose R>ecent uploads option
- LONG IF Reply$ <> "R"
- GOTO "Exit File Search"
- END IF
- Temp$ = "How many days back (1-180) " + Return$ + "? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- GOSUB "Echo LF"
- WhatsNew = VAL(Reply$)
- IF (WhatsNew < 1) OR (WhatsNew > 180) THEN "Exit File Search"
- END IF
- END IF
- LONG IF Command <> 96
- OPEN "I", 2, Option$,, F%
- LINE INPUT #2, Option$
- LINE INPUT #2, Section$
- END IF
- "File Search Loop"
- OPEN "I", 1, Option$, 920, V%
- NoHit = TRUE
- LONG IF FirstTime
- Temp$ = Proceed$
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- END IF
- FirstTime = FALSE
- DoneHere = FALSE
- IF (Command = 87) AND (LOF(1) > 0) THEN RECORD #1, (LOF(1) - 1)
- MarkPlace1& = REC(1)
- WHILE (NOT EOF(1)) AND (NOT Interrupt) AND (NOT DoneHere) AND (LOF(1) > 0)
- ShowFlag = FALSE
- READ #1, Delete$;1,FSec$;13,FLen$;4,FType$;1,WhoSent$;32,Ver$;10
- READ #1, WhenUL$;6,Clearance$;1,Path$;81,Junk$;1,DL$;4,LastDL$;6
- FOR Count = 1 TO 10
- READ #1, FSec$(Count);76
- LONG IF (LEFT$(FSec$(Count), 1) > CHR$(0))
- FSec$(Count) = FN MakeStr$(FSec$(Count))
- XELSE
- FSec$(Count) = ""
- END IF
- LONG IF ((Command = 89) OR (Command = 96)) AND (ArchClearance => ASC(Clearance$))
- LONG IF FSec$(Count) <> "" AND (ASC(Delete$) = 0)
- IF (INSTR(1, UCASE$(FSec$(Count)), LookFor$) > 0) THEN ShowFlag = TRUE
- END IF
- END IF
- NEXT Count
- ' If the file is active...
- LONG IF (ASC(Delete$) = 0)
- FSec$ = FN MakeStr$(FSec$)
- LONG IF ((Command = 89) OR (Command = 96)) AND (ArchClearance => ASC(Clearance$))
- IF (INSTR(1, UCASE$(FSec$), LookFor$) > 0) THEN ShowFlag = TRUE
- END IF
- LONG IF ((Command = 87) OR (Command = 88)) AND (ArchClearance => ASC(Clearance$))
- Month% = ASC(MID$(WhenUL$, 1, 1))
- Day% = ASC(MID$(WhenUL$, 2, 1))
- Year% = ASC(MID$(WhenUL$, 3, 1))
- GOSUB "Count the Days"
- FileGotHere& = Day% + (Year% * 365.25)
- Qualify% = NowaDays& - FileGotHere&
- IF Qualify% < WhatsNew THEN ShowFlag = TRUE
- END IF
- IF (LEFT$(FSec$(1), 1) = "*") AND (ArchClearance < 200) THEN ShowFlag = FALSE
- LONG IF ShowFlag
- NoHit = FALSE
- Temp = LEN(FSec$)
- IF Temp < 12 THEN FSec$ = FSec$ + SPACE$(12 - Temp)
- Long$ = FLen$
- GOSUB "Decode Long"
- Long& = (Long& + 512) / 1024
- FLen$ = STR$(Long&)
- FLen$ = RIGHT$(FLen$, LEN(FLen$) - 1)
- IF FLen$ = "0" THEN FLen$ = "<1"
- FLen$ = FLen$ + "K "
- Temp = LEN(FLen$)
- IF LEN(FLen$) < 6 THEN FLen$ = FLen$ + SPACE$(6 - Temp)
- Source$ = WhenUL$
- GOSUB "Make Date String"
- WhenUL$ = DateTime$
- Source$ = LastDL$
- GOSUB "Make Date String"
- LastDL$ = DateTime$
- FType = ASC(FType$)
- SELECT CASE FType
- CASE 0
- FType$ = "Macintosh Application"
- CASE 1
- FType$ = "Macintosh Document"
- CASE 2
- FType$ = "Non-Macintosh File"
- CASE 3
- FType$ = "Plain Text File"
- END SELECT
- Ver$ = FN MakeStr$(Ver$)
- Temp = LEN(Ver$)
- LONG IF Temp = 0
- Ver$ = "[none] "
- Temp = 9
- END IF
- IF LEN(Ver$) < 9 THEN Ver$ = Ver$ + SPACE$(9 - Temp)
- GOSUB "Check Interrupt"
- LONG IF NOT Interrupt
- Temp$ = "Title: "+FSec$+" Size: "+FLen$+" Version: "+Ver$+" Uploaded: "+WhenUL$
- GOSUB "Newline Echo"
- END IF
- Long$ = DL$
- GOSUB "Decode Long"
- Long$ = STR$(Long&)
- DL$ = RIGHT$(Long$, LEN(Long$) -1)
- WHILE LEN(DL$) < 4
- DL$ = DL$ + " "
- WEND
- WhoSent$ = FN MakeStr$(WhoSent$)
- GOSUB "Check Interrupt"
- LONG IF NOT Interrupt
- Temp$ = "Downloads: "+DL$+" Last Download: "+LastDL$+" Uploader: "+WhoSent$
- GOSUB "Newline Echo"
- LONG IF Command <> 96
- Temp$ = "Location: " + Section$
- GOSUB "Newline Echo"
- END IF
- END IF
- FOR Count = 1 TO 10
- LONG IF FSec$(Count) <> ""
- Temp$ = FSec$(Count)
- GOSUB "Newline Echo"
- END IF
- GOSUB "Check Interrupt"
- IF Interrupt THEN Count = 10
- NEXT Count
- GOSUB "Echo LF"
- END IF
- END IF
- GOSUB "Check Interrupt"
- GOSUB "Check Modem"
- IF (OneByOne AND ShowFlag) THEN GOSUB "FSec Reply"
- LONG IF Command = 87
- LONG IF MarkPlace1& > 0
- MarkPlace1& = MarkPlace1& - 1
- RECORD #1, MarkPlace1&
- XELSE
- DoneHere = TRUE
- END IF
- IF ShowFlag = FALSE THEN DoneHere = TRUE
- END IF
- WEND
- LONG IF (Command <> 96)
- LONG IF NoHit AND (NOT Interrupt)
- Temp$ = "[No match in " + Section$ + "]"
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- END IF
- LONG IF NOT EOF(2)
- CLOSE #1
- "FSec Closed"
- Option$ = ""
- Section$ = ""
- LINE INPUT #2, Option$
- IF NOT EOF(2) THEN LINE INPUT #2, Section$
- IF (Option$ <> "") AND (Section$ <> "") THEN GOTO "File Search Loop"
- END IF
- CLOSE #2
- XELSE: REM Command = 96
- LONG IF NoHit AND (NOT Interrupt)
- Temp$ = "[No match]"
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- END IF
- END IF
- CLOSE #1
- IF (NOT Interrupt) THEN GOSUB "Hit Key to Continue"
- "Exit File Search"
- ON ERROR GOSUB "Exit"
- SEGMENT RETURN
- '
- ' ------------- FSec Reply -------------
- "FSec Reply"
- Temp$ = NextQuitCont$
- GOSUB "Noline Echo"
- GOSUB "Get Reply"
- GOSUB "Echo LF"
- IF Reply$ = "N" THEN "FSec Escape"
- IF Reply$ = CR$ THEN "FSec Escape No LF"
- LONG IF Reply$ = "Q"
- Interrupt = TRUE
- GOTO "FSec Escape"
- END IF
- LONG IF Reply$ = "C"
- OneByOne = FALSE
- GOTO "FSec Escape"
- END IF
- GOTO "FSec Reply"
- "FSec Escape"
- GOSUB "Echo LF"
- "FSec Escape No LF"
- RETURN
- '
- ' ------------- Make Date String -------------
- "Make Date String"
- Index = 1
- GOSUB "Justify"
- DateTime$ = Temp$ + "/"
- Index = 2
- GOSUB "Justify"
- DateTime$ = DateTime$ + Temp$ + "/"
- Index = 3
- GOSUB "Justify"
- DateTime$ = DateTime$ + Temp$
- RETURN
- '
- ' ------------- Justify -------------
- "Justify"
- Temp$ = STR$(ASC(MID$(Source$, Index, 1)))
- Temp$ = RIGHT$(Temp$, LEN(Temp$) - 1)
- IF LEN(Temp$) = 1 THEN Temp$ = "0" + Temp$
- RETURN
- '
- ' ------------- Decode Long -------------
- "Decode Long"
- Long& = 0
- FOR Count% = 1 TO 4
- Temp1$ = MID$(Long$, Count%, 1)
- Long& = (ASC(Temp1$) * 256^(4 - Count%)) + Long&
- NEXT Count%
- RETURN
- '
- ' ------------- Read Directory -------------
- SEGMENT
- "Directory"
- '
- OneDir = FALSE
- GOSUB "Echo LF"
- Temp$ = "Do you want to see the contents of a Specific directory or of"
- GOSUB "Newline Echo"
- Temp$ = "All mounted volumes? <S,A> "
- GOSUB "Noline Echo"
- GOSUB "Get Reply"
- GOSUB "Echo LF"
- GOSUB "Echo LF"
- LONG IF Reply$ = "S"
- OneDir = TRUE
- GOTO "One Directory"
- END IF
- Temp$ = "This command displays the directories of all mounted volumes. This"
- GOSUB "Newline Echo"
- Temp$ = "may take a while. Do you want to see the directories? <Y/N> "
- GOSUB "Noline Echo"
- GOSUB "Get Reply"
- IF Reply$ = "N" THEN "Exit Dir"
- ' The following routine was borrowed from samples supplied with ZBasic.
- ' It's poorly annotated and hastily adapted, but it works.
- GOSUB "Echo LF"
- GOSUB "Echo LF"
- Temp$ = Proceed$
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- L = 0
- L2 = 0
- Temp$ = "Path:filenames"
- GOSUB "Newline Echo"
- FOR Count& = 1 TO 10000
- VolumeID$ = FILES$(-Count&,"",,V%)
- LONG IF (V% = 0) OR (VolumeID$ = "")
- Count& = 10000
- XELSE
- GOSUB "Echo LF"
- Volume$(L) = VolumeID$
- L = L+1
- L2 = L
- "DirLoop"
- IF L > L2 THEN L2 = L2 + 1:VolumeID$ = Volume$(L2-1)
- FOR Count2& = 1 TO 10000
- FileID$=FILES$(-Count2&,"",VolumeID$,V%)
- LONG IF FileID$ = ""
- Count2& = 10000
- XELSE
- LONG IF RIGHT$(FileID$,1) <> ":"
- Temp$ = VolumeID$ + FileID$
- GOSUB "Newline Echo"
- END IF
- GOSUB "Check Modem"
- Colon$ = RIGHT$(FileID$,1)
- LONG IF Colon$ = ":"
- Volume$(L) = VolumeID$ + FileID$
- L = L+1
- END IF
- END IF
- GOSUB "Check Interrupt"
- IF Interrupt THEN Count2& = 10000:L2 = L:Count& = 10000
- NEXT Count2&
- IF L2 < L THEN "DirLoop"
- END IF
- NEXT Count&
- GOSUB "Echo LF"
- "One Directory"
- LONG IF OneDir = TRUE
- FileFound = FALSE
- Temp$ = "Volume to show? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF Reply$ = "" THEN "No Dir"
- Volume$ = Reply$
- IF RIGHT$(Volume$, 1) <> ":" THEN Volume$ = Volume$ + ":"
- Temp$ = Proceed$
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- FOR Count% = 1 TO 5000
- Temp$ = FILES$(-Count%,"",Volume$,V%)
- LONG IF Temp$ <> ""
- FileFound = TRUE
- GOSUB "Newline Echo"
- XELSE
- LONG IF (FileFound = FALSE)
- Temp$ = "Directory is undefined or empty."
- GOSUB "Newline Echo"
- END IF
- Count% = 5000
- END IF
- GOSUB "Check Modem"
- GOSUB "Check Interrupt"
- IF Interrupt THEN Count% = 5000
- NEXT Count%
- GOSUB "Echo LF"
- IF (NOT Interrupt) THEN "One Directory"
- END IF
- "No Dir"
- REM Following lines return default filepath to Host volume.
- REM (It can be reset by the Directory command.)
- Count% = 1
- DO
- FileID$ = FILES$(-Count%,"",HostPath$,V%)
- Count% = Count% + 1
- UNTIL (FileID$ = HostName$) OR (FileID$ = "")
- LONG IF FileID$ = ""
- Temp$ = "Can't find Host!"
- GOSUB "Newline Echo"
- Temp$ = "Hit any key to reset system"
- GOSUB "Newline Echo"
- GOSUB "Get A Key"
- GOTO "Argh!"
- END IF
- "Exit Dir"
- GOSUB "Hit Key to Continue"
- SEGMENT RETURN
- '
- ' ------------- Kill a File -------------
- "Kill File"
- GOSUB "Echo LF"
- Temp$ = "Enter path:filename of file to delete: "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- LONG IF Reply$ <> ""
- Kill$ = Reply$
- Temp$ = "Do you *really* want to delete " + Kill$ + "? "
- GOSUB "Noline Echo"
- Temp$ = Reply$
- GOSUB "Get A Line"
- LONG IF LEFT$(Reply$,1) = "Y"
- KILL Kill$
- Temp$ = Kill$ + " has been deleted."
- GOSUB "Newline Echo"
- END IF
- END IF
- GOSUB "Hit Key to Continue"
- RETURN
- '
- ' ------------- Backup UserLog -------------
- "Back UserLog"
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Deleted = 0
- DEF OPEN = "ULOGULED"
- MarkPlace1& = 0
- MarkPlace2& = 0
- OPEN "I", 1, UserLog$, 136
- Temp$ = UserLog$
- GOSUB "Path Finder"
- UserLogPath$ = Temp$
- Temp$ = UserLogPath$ + "UserLog.bak"
- OPEN "O", 2, Temp$, 136
- GOSUB "Echo LF"
- Temp$ = StandBy$
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- WHILE NOT EOF(1)
- RECORD #1, MarkPlace1&
- READ #1, Temp$;136
- MarkPlace1& = REC(1)
- Flag$ = MID$(Temp$, 86, 1)
- LONG IF ((ASC(Flag$) AND 64) = 64)
- Deleted = Deleted + 1
- GOTO "Skip User"
- END IF
- RECORD #2, MarkPlace2&
- WRITE #2, Temp$;136
- MarkPlace2& = REC(2)
- "Skip User"
- WEND
- CLOSE 1
- CLOSE 2
- DEF OPEN = "TEXTQED1"
- Temp$ = UserLogPath$ + "UserLog.$$$"
- RENAME UserLog$ TO Temp$
- Temp$ = UserLogPath$ + "UserLog.bak"
- RENAME Temp$ TO UserLog$
- Temp$ = UserLogPath$ + "UserLog.$$$"
- Temp1$ = UserLogPath$ + "UserLog.bak"
- RENAME Temp$ TO Temp1$
- GOSUB "Echo LF"
- Place% = 0
- Temp = Deleted
- GOSUB "Format Number"
- Temp$ = Temp$ + " users were deleted."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- GOSUB "Flush Keystrokes"
- Temp$ = "Do you want to erase the UserLog backup (Y,N)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- GOSUB "Echo LF"
- LONG IF UCASE$(LEFT$(Reply$, 1)) = "Y"
- Temp$ = UserLogPath$ + "UserLog.bak"
- KILL Temp$
- END IF
- END IF
- RETURN
- '
- ' ------------- Clear SYSMSG -------------
- "Clear SYSMSG"
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Temp$ = "This command clears message flags in the UserLog so your callers"
- GOSUB "Newline Echo"
- Temp$ = "will see one or more freshly-posted SYSTEMx.MSGs."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "Clear SYSTEM.MSG 1, 2, 3, All or Quit (1, 2, 3, A, Q)? "
- GOSUB "Noline Echo"
- GOSUB "Get Reply"
- IF Reply$ <> CR$ THEN GOSUB "Echo LF"
- SysMsgFlag = 0
- IF Reply$ = "1" THEN SysMsgFlag = 247
- IF Reply$ = "2" THEN SysMsgFlag = 239
- IF Reply$ = "3" THEN SysMsgFlag = 223
- IF Reply$ = "A" THEN SysMsgFlag = 199
- IF Reply$ = "Q" THEN "Escape ClearFlags"
- LONG IF SysMsgFlag
- Temp1$ = Reply$
- GOSUB "Echo LF"
- Temp$ = "Are you sure you want to clear "
- LONG IF SysMsgFlag <> 199
- Temp$ = Temp$ +"SYSTEM"+Temp1$+".MSG flags? "
- XELSE
- Temp$ = Temp$ +"all three SYSTEM.MSG flags? "
- END IF
- GOSUB "Noline Echo"
- GOSUB "Get Reply"
- IF Reply$ <> CR$ THEN GOSUB "Echo LF"
- IF Reply$ <> "Y" THEN "Escape ClearFlags"
- GOSUB "Echo LF"
- Temp$ = StandBy$
- GOSUB "Newline Echo"
- OPEN "R", 1, UserLog$, 136
- ULength = LOF(1, 136)
- Position = 0
- WHILE (ULength - Position > 0)
- RECORD #1, Position, 85
- READ #1, Flag$;1
- Flag$ = CHR$(ASC(Flag$) AND SysMsgFlag)
- RECORD #1, Position, 85
- WRITE #1, Flag$;1
- Position = Position + 1
- WEND
- CLOSE #1
- GOSUB "Echo LF"
- END IF
- END IF
- "Escape ClearFlags"
- RETURN
- '
- ' ------------- Set/Clear User Restriction Flags -------------
- "RestrictFlags"
- GOSUB "UserLog Password"
- GOSUB "Echo LF"
- LONG IF Password
- Temp$ = "This command sets or clears restriction flags for ALL UserLog entries."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "Set, Clear, Quit (S,C,Q)? "
- GOSUB "Noline Echo"
- GOSUB "Get Reply"
- IF Reply$ <> CR$ THEN GOSUB "Echo LF"
- GOSUB "Echo LF"
- LONG IF (Reply$ = "S") OR (Reply$ = "C")
- LONG IF Reply$ = "S"
- Flag = TRUE
- Operate$ = " set "
- XELSE
- Flag = FALSE
- Operate$ = " clear "
- END IF
- Temp$ = "Flag to" + Operate$ + "(1-24)? "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- GOSUB "Echo LF"
- FlagNo = VAL(Reply$)
- FlagNo = FlagNo - 1
- LONG IF (FlagNo => 0) AND (FlagNo =< 23)
- Temp$ = "Are you sure you want to" + Operate$ + "flag "
- Temp$ = Temp$ + Reply$ + " for ALL UserLog entries (Y,N)? "
- GOSUB "Echo LF"
- GOSUB "Noline Echo"
- GOSUB "Get Reply"
- IF Reply$ <> CR$ THEN GOSUB "Echo LF"
- GOSUB "Echo LF"
- LONG IF Reply$ = "Y"
- ' find out which of the three bytes to alter
- ' (bytes are in reverse order: 99, 98, 97)
- Offset = 99 - (FlagNo / 8)
- ' find out which bit to alter
- Temp1 = (FlagNo MOD 8)
- FlagNo = 2^Temp1
- ' AND with 255 to strip longint value
- IF NOT Flag THEN FlagNo = (NOT FlagNo) AND 255
- Temp$ = StandBy$
- GOSUB "Newline Echo"
- OPEN "R", 1, UserLog$, 136
- ULength = LOF(1, 136)
- Position = 0
- WHILE (ULength - Position) > 0
- RECORD #1, Position, Offset
- READ #1, Flag$;1
- LONG IF Flag
- Flag$ = CHR$(ASC(Flag$) OR FlagNo)
- XELSE: REM NOT Flag
- Flag$ = CHR$(ASC(Flag$) AND FlagNo)
- END IF
- RECORD #1, Position, Offset
- WRITE #1, Flag$;1
- Position = Position + 1
- WEND
- CLOSE #1
- END IF
- END IF
- END IF
- END IF
- RETURN
- '
- ' ------------- Analyze CallerLog -------------
- '
- SEGMENT
- "Analyze CLog"
- Temp$ = StandBy$
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Connections% = 0
- Connect% = FALSE
- B03% = 0
- B12% = 0
- B24% = 0
- B96% = 0
- B192% = 0
- LocalKey% = 0
- UL% = 0
- Ux% = 0
- DL% = 0
- Dx% = 0
- PubMsg% = 0
- PriMsg% = 0
- ExPgm% = 0
- Exp% = 0
- Lost% = 0
- CLTimeTotal& = 0
- FirstTime% = TRUE
- WentToSleep% = 0
- NoLog% = 0
- TextRead% = 0
- HostErr% = 0
- TSYNCH% = 0
- Off% = 0
- NetMail% = 0
- FOR Count = 1 TO 9
- Caller$(Count) = ""
- NEXT Count
- OPEN "I", 1, Option$, 1
- GOSUB "Echo LF"
- Temp$ = Proceed$
- GOSUB "Newline Echo"
- WHILE (NOT EOF(1)) AND (NOT Interrupt)
- LINE INPUT#1, Temp$
- LONG IF (INSTR(1, Temp$, "Connection made at") > 0)
- Connections% = Connections% + 1
- GOSUB "Make Minutes"
- LogOnTime& = TotalMinutes&
- Temp% = INSTR(1, Temp$, " on ")
- ThisLog$ = RIGHT$(Temp$, LEN(Temp$) - Temp% + 1)
- LONG IF FirstTime%
- LogStartTime& = LogOnTime&
- FirstLog$ = RIGHT$(ThisLog$, LEN(ThisLog$) - 4)
- FirstLog$ = "First caller: " + FirstLog$
- FirstTime% = FALSE
- END IF
- Connect% = TRUE
- CheckedIn% = FALSE
- IF (INSTR(18, Temp$, "300 baud") > 0) THEN B03% = B03% + 1
- IF (INSTR(18, Temp$, "1200 baud") > 0) THEN B12% = B12% + 1
- IF (INSTR(18, Temp$, "2400 baud") > 0) THEN B24% = B24% + 1
- IF (INSTR(18, Temp$, "9600 baud") > 0) THEN B96% = B96% + 1
- IF (INSTR(18, Temp$, "19200 baud") > 0) THEN B192% = B192% + 1
- IF (INSTR(18, Temp$, "local keyboard") > 0) THEN LocalKey% = LocalKey% + 1
- LONG IF NOT EOF(1) AND (NOT Interrupt)
- LINE INPUT#1, Temp$
- Temp1 = INSTR(1, Temp$, " from ")
- LONG IF Temp1 > 0
- CheckedIn% = TRUE
- LONG IF LEFT$(Caller$(9), Temp1) <> LEFT$(Temp$, Temp1): REM Don't list repeat callers
- FOR Count = 1 TO 8
- Caller$(Count) = Caller$(Count + 1)
- NEXT Count
- Caller$(9) = Temp$ + ThisLog$
- END IF: REM Caller$(9) <> Temp$
- XELSE
- LONG IF (INSTR(1, Temp$, "TSYNCH received") > 0)
- TSYNCH% = TSYNCH% + 1
- END IF
- END IF: REM -- Temp1 > 0
- END IF: REM -- NOT EOF(1) AND (NOT Interrupt)
- LONG IF (NOT EOF(1)) AND (NOT Interrupt)
- LINE INPUT#1, Temp$
- END IF
- END IF:REM -- (INSTR(1, Temp$, "Connection made at") > 0)
- '
- LONG IF (INSTR(2, Temp$, "load") > 0)
- IF (INSTR(1, Temp$, "Uploaded") > 0) THEN UL% = UL% + 1
- LONG IF (INSTR(1, Temp$, "Upload cancelled") > 0)
- IF UL% > 0 THEN UL% = UL% - 1
- Ux% = Ux% + 1
- END IF
- IF (INSTR(1, Temp$, "Downloaded") > 0) THEN DL% = DL% + 1
- LONG IF (INSTR(1, Temp$, "Download cancelled") > 0)
- IF DL% > 0 THEN DL% = DL% - 1
- Dx% = Dx% + 1
- END IF
- END IF
- '
- LONG IF (INSTR(6, Temp$, " message ") > 0)
- IF (INSTR(1, Temp$, "Public message") > 0) THEN PubMsg% = PubMsg% + 1
- IF (INSTR(1, Temp$, "Private message") > 0) THEN PriMsg% = PriMsg% + 1
- END IF
- '
- IF (INSTR(1, Temp$, " text file <") > 0) THEN TextRead% = TextRead% +1
- IF (INSTR(1, Temp$, "Launching external ") > 0) THEN ExPgm% = ExPgm% + 1
- LONG IF (INSTR(1, Temp$, "Logged off") > 0)
- GOSUB "Make Minutes"
- LogOffTime& = TotalMinutes&
- IF Connect% = TRUE THEN CLTimeTotal& = CLTimeTotal& + LogOffTime& - LogOnTime&
- Connect% = FALSE
- IF CheckedIn% = FALSE THEN NoLog% = NoLog% + 1
- Off% = Off% + 1
- END IF
- LONG IF (INSTR(1, Temp$, "Time limit expired!") > 0)
- Exp% = Exp% + 1
- END IF
- LONG IF (INSTR(1, Temp$, "terminated due to inactivity") > 0)
- WentToSleep% = WentToSleep% + 1
- END IF
- LONG IF (INSTR(1, Temp$, "Modem lost carrier ") > 0)
- Lost% = Lost% + 1
- END IF
- LONG IF (INSTR(1, Temp$, "** Error <") > 0)
- HostErr% = HostErr% + 1
- END IF
- LONG IF (INSTR(1, Temp$, "network mail application") > 0)
- NetMail% = NetMail% + 1
- END IF
- '
- Check = Check + 1
- GOSUB "Check Modem"
- GOSUB "Check Interrupt"
- WEND
- CLOSE #1
- IF Interrupt THEN "Exit Analysis"
- NormOff% = Connections% - Exp% - Lost%
- B! = B03% + B12% + B24% + B96%
- B03P% = (100.0 * B03% \ B!) + 0.5
- B12P% = (100.0 * B12% \ B!) + 0.5
- B24P% = (100.0 * B24% \ B!) + 0.5
- B96P% = (100.0 * B96% \ B!) + 0.5
- B192P% = (100.0 * B192% \ B!) + 0.5
- GOSUB "Echo LF"
- Temp$ = " BBS Activity"
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = FirstLog$
- GOSUB "Newline Echo"
- Temp = Connections%
- GOSUB "Format Number"
- Temp1$ = "Calls: " + Temp$
- Temp = CLTimeTotal& / Connections%
- GOSUB "Format Number"
- Temp$ = Temp1$ + " Average: " + Temp$ + " minutes "
- GOSUB "Noline Echo"
- Temp! = CLTimeTotal& \ 60
- Temp = INT(Temp!)
- GOSUB "Format Number"
- Temp1$ = Temp$
- Temp = (CLTimeTotal& MOD 60)
- GOSUB "Format Number"
- IF LEN(Temp$) = 1 THEN Temp$ = "0" + Temp$
- Temp$ = "Use: " + Temp1$ + ":" + Temp$ + " ("
- GOSUB "Noline Echo"
- Temp! = 0.5 + (100.0 * (CLTimeTotal& \ (LogOffTime& - LogStartTime&)))
- Temp = INT(Temp!)
- GOSUB "Format Number"
- Temp$ = Temp$ + "%)"
- GOSUB "Newline Echo"
- Temp = PubMsg%
- GOSUB "Format Number"
- Temp1$ = "Public messages: " + Temp$ + " Private messages: "
- Temp = PriMsg%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$
- Temp = UL%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + " Uploads: " + Temp$ + " Downloads: "
- Temp = DL%
- GOSUB "Format Number"
- Temp$ = Temp1$ + Temp$
- GOSUB "Newline Echo"
- Temp = B03%
- GOSUB "Format Number"
- Temp1$ = "300: " + Temp$ + " ("
- Temp = B03P%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$ + "%) 1200: "
- Temp = B12%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$ + " ("
- Temp = B12P%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$ + "%) 2400: "
- Temp = B24%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$ + " ("
- Temp = B24P%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$ + "%) 9600: "
- Temp = B96%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$ + " ("
- Temp = B96P%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$ + "%) 19200: "
- Temp = B192%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$ + " ("
- Temp = B192P%
- GOSUB "Format Number"
- Temp$ = Temp1$ + Temp$ + "%)"
- GOSUB "Newline Echo"
- Temp1$ = "Local connects: "
- Temp = LocalKey%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$ + " "
- Temp = Ux%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + " File transfers cancelled: " + Temp$ + " uploads and "
- Temp = Dx%
- GOSUB "Format Number"
- Temp$ = Temp1$ + Temp$ + " downloads"
- GOSUB "Newline Echo"
- Temp = ExPgm%
- GOSUB "Format Number"
- Temp1$ = "External program launches: " + Temp$ + " Text file reads: "
- Temp = TextRead%
- GOSUB "Format Number"
- Temp$ = Temp1$ + Temp$
- GOSUB "Newline Echo"
- Temp = NormOff%
- GOSUB "Format Number"
- Temp1$ = "Exits: " + Temp$ + " normal, "
- Temp = Exp%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$ + " time expired, "
- Temp = Lost%
- GOSUB "Format Number"
- Temp1$ = Temp1$ + Temp$ + " carrier lost and "
- Temp = WentToSleep%
- GOSUB "Format Number"
- Temp$ = Temp1$ + Temp$ + " inactivity"
- GOSUB "Newline Echo"
- Temp = NoLog%
- GOSUB "Format Number"
- Temp$ = "Connect, no log: " + Temp$ + " "
- GOSUB "Noline Echo"
- Temp = HostErr%
- GOSUB "Format Number"
- Temp$ = "Host errors: " + Temp$ + " "
- GOSUB "Newline Echo"
- Temp = NetMail%
- GOSUB "Format Number"
- Temp1$ = "Netmail events: " + Temp$ + " Crashmail events: "
- Temp = TSYNCH%
- GOSUB "Format Number"
- Temp$ = Temp1$ + Temp$ + " Disk space free: "
- GOSUB "Noline Echo"
- GOSUB "Free Space"
- PRINT #Device, USING "###,###";freeKBytes&;"K";EOL$;
- IF NOT Local THEN PRINT USING "###,###";freeKBytes&;"K"
- GOSUB "Echo LF"
- Temp$ = "Most recent callers (old to new):"
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- FOR Count = 1 TO 8
- Temp$ = Caller$(Count)
- LONG IF Count = 8 AND Temp$ = ""
- Temp$ = "<No information available>"
- END IF
- IF Temp$ <> "" THEN GOSUB "Newline Echo"
- NEXT Count
- "Exit Analysis"
- GOSUB "Hit Key to Continue"
- SEGMENT RETURN
- '
- ' ------------- Calculate Minutes -------------
- ' Enter with Temp$ from CallerLog, returns TotalMinutes& with minutes
- '
- "Make Minutes"
- MDY$ = MID$(Temp$, (INSTR(28, Temp$, " on ") + 4), 8)
- HMS$ = MID$(Temp$, (INSTR(19, Temp$, " at ") + 4), 8)
- LONG IF INSTR(1, Temp$, "Logged off") > 0
- MDY$ = MID$(Temp$, 15, 8)
- HMS$ = MID$(Temp$, 27, 8)
- END IF
- '
- ' HMS$ is a string in the form "HH:MM:SS"
- '
- Hour% = VAL(LEFT$(HMS$, 2))
- Min% = VAL(MID$(HMS$, 4, 2))
- Sec% = VAL(RIGHT$(HMS$, 2))
- IF Sec% > 29 THEN Min% = Min% + 1
- TotalMinutes& = Min% + (60 * Hour%)
- GOSUB "Decode Date String"
- GOSUB "Count the Days"
- TotalMinutes& = TotalMinutes& + (24 * 60 * Day%)
- ' -- Next line gets year of current system date
- Temp% = VAL(RIGHT$(DATE$, 2))
- Year% = Temp% - Year%
- TotalMinutes& = TotalMinutes& + (365 * 24 * 60 * Year%)
- RETURN
- '
- ' ------------- Decode Date String -------------
- "Decode Date String"
- '
- ' MDY$ is a string in the form "MM/DD/YY"
- ' Returns Month%, Day%, Year%
- '
- Month% = VAL(LEFT$(MDY$, 2))
- Day% = VAL(MID$(MDY$, 4, 2))
- Year% = VAL(RIGHT$(MDY$, 2))
- RETURN
- '
- ' ------------- Count the Days -------------
- "Count the Days"
- '
- ' Enter with Day%, Month% and Year%
- ' Returns the day this is within the year in Day%
- '
- SELECT Month%
- CASE 1:Temp% = 0
- CASE 2:Temp% = 31
- CASE 3:Temp% = 59
- CASE 4:Temp% = 90
- CASE 5:Temp% = 120
- CASE 6:Temp% = 151
- CASE 7:Temp% = 181
- CASE 8:Temp% = 212
- CASE 9:Temp% = 243
- CASE 10:Temp% = 273
- CASE 11:Temp% = 304
- CASE 12:Temp% = 334
- END SELECT
- Day% = Day% + Temp%
- IF (Year% MOD 4) = 0 THEN IF Month% > 2 THEN Day% = Day% + 1
- RETURN
- '
- ' ------------- Free Space -------------
- "Free Space"
- ' Get volume information
- '
- hParamBlkPtr& = VARPTR(paramBlock$)
- ioCompletion& = 0
- POKE LONG hParamBlkPtr& + 12, ioCompletion&
- ioNamePtr& = VARPTR(VolName$)
- POKE LONG hParamBlkPtr& + 18, ioNamePtr&
- '
- ioVRefNum% = 0 : ' 0 is default volume
- POKE WORD hParamBlkPtr& + 22, ioVRefNum%
- ioVolIndex% = 0 : ' 0 is default volume
- POKE WORD hParamBlkPtr& + 28, ioVolIndex%
- '
- GET VOLUME INFO paramBlock$
- ioVAlBlkSiz& = PEEK LONG(hParamBlkPtr& + 48)
- ioVFrBlk& = PEEK WORD(hParamBlkPtr& + 62)
- IF ioVFrBlk& < 0 THEN ioVFrBlk& = ioVFrBlk& + 65535
- freeKBytes& = (ioVAlBlkSiz& * ioVFrBlk&) / 1024
- RETURN
- '
- ' ------------- Last Callers -------------
- "Last Callers"
- FOR Count = 1 TO 9
- Caller$(Count) = ""
- NEXT Count
- OPEN "I", 1, Option$, 1
- WHILE (NOT EOF(1)) AND (NOT Interrupt)
- LINE INPUT#1, Temp$
- Temp1 = INSTR(1, Temp$, " from ")
- LONG IF Temp1
- LONG IF LEFT$(Caller$(9), Temp1) <> LEFT$(Temp$, Temp1): REM Don't list repeat callers
- Caller$(9) = Temp$
- FOR Count = 1 TO 8
- Caller$(Count) = Caller$(Count + 1)
- NEXT Count
- END IF: REM Caller$(9) <> Temp$
- END IF: REM Temp1 > 0
- GOSUB "Check Modem"
- GOSUB "Check Interrupt"
- WEND
- CLOSE #1
- LONG IF NOT Interrupt
- GOSUB "Echo LF"
- Temp$ = "Most recent callers (old to new):"
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- FOR Count = 1 TO 8
- Temp$ = Caller$(Count)
- LONG IF Count = 8 AND Temp$ = ""
- Temp$ = "<No information available>"
- END IF
- IF Temp$ <> "" THEN GOSUB "Newline Echo"
- NEXT Count
- END IF: REM NOT Interrupt
- GOSUB "Hit Key to Continue"
- RETURN
- '
- ' ------------- Check Modem -------------
- "Check Modem"
- GOSUB "Turn Menus On"
- LONG IF NOT Local
- LONG IF (PEEK(Modem) AND Hang) <> 0
- GOSUB "Flush Keystrokes"
- PRINT #Port, "ATS0=0"
- DELAY 500
- GOTO "Exit"
- END IF
- END IF
- RETURN
- '
- ' ------------- Get Reply -------------
- '
- ' This routine handles caller input based on UserLog info.
- '
- "Get Reply"
- LONG IF HotMenus
- GOSUB "Get A Key"
- Reply$ = UCASE$(Hit$)
- XELSE
- GOSUB "Get A Line"
- END IF
- RETURN
- '
- ' ------------- Get A Line From User -------------
- '
- ' This routine translates user input to uppercase, handles
- ' backspaces and forms lines.
- '
- "Get A Line"
- LineCounter% = 1
- LONG IF NOT Local
- Reply$ = ""
- Hit$ = ""
- WHILE Hit$ <> CR$ AND LineCounter% < 80
- GOSUB "Get A Key"
- Hit$ = UCASE$(Hit$)
- LineCounter% = LineCounter% + 1
- IF Hit$ => " " THEN Reply$ = Reply$ + Hit$
- LONG IF Hit$ = CHR$(8)
- Reply$ = LEFT$(Reply$, LEN(Reply$) - 1)
- LineCounter% = LineCounter% + 1
- END IF
- WEND
- GOSUB "Echo LF"
- XELSE
- LINE INPUT "";Reply$
- Reply$ = UCASE$(Reply$)
- END IF
- RETURN
- '
- ' ------------- Get A Key Of User Input -------------
- '
- ' This routine gets a keystroke from the local or remote keyboard
- ' and times out to an exit if there's no user input for the value
- ' set in the Config file. As long as we're looking, we also check
- ' Carrier Detect for remote callers and exit if it's not there.
- '
- "Get A Key"
- Elapsed = 0
- TimeFlag = FALSE
- WHILE Elapsed < Inactivity
- ': ChatFlag is set true by Chat menu item
- IF ChatFlag THEN GOSUB "Chat"
- GOSUB "Check Modem"
- Hit$ = INKEY$
- IF (NOT Local) AND (LEN(Hit$) = 0) THEN READ #Port, Hit$;0
- LONG IF LEN(Hit$)
- ' next line filters out +++ combinations to modem (maybe?)
- IF Hit$ = "+" THEN IF NOT Local THEN Hit$ = CHR$(19) + "+" + CHR$(17)
- IF NOT NoShow THEN Temp$ = Hit$:GOSUB "Noline Echo"
- NoShow = FALSE
- RETURN
- END IF
- "Timing Loop"
- LONG IF NOT TimeFlag
- Temp$ = TIME$
- Started = FN MakeTime
- TimeFlag = TRUE
- END IF
- GOSUB "Turn Menus On"
- Temp$ = TIME$
- Temp = FN MakeTime
- Elapsed = Temp - Started
- ' Mext line adjusts for hour boundary
- LONG IF Elapsed < 0
- Started = Started - 3600
- Elapsed = Temp - Started
- END IF
- WEND
- ' The only way to get to the next line is if Elapsed > Inactivity
- GOTO "Exit"
- '
- ' ------------- Check for Interrupt -------------
- "Check Interrupt"
- Interrupt = FALSE
- IF Local THEN Break$ = INKEY$ ELSE READ #Port, Break$;0
- LONG IF LEN(Break$)
- Break$ = UCASE$(Break$)
- LONG IF (Break$ = "S") OR (Break$ = CHR$(19))
- NoShow = TRUE
- GOSUB "Get A Key"
- Break$ = ""
- Hit$ = ""
- END IF
- IF (Break$ = "C") OR (Break$ = CHR$(3)) THEN Interrupt = TRUE
- END IF
- RETURN
- '
- ' ------------- Newline Echo -------------
- "Newline Echo"
- LF = TRUE
- GOSUB "Echo"
- RETURN
- '
- ' ------------- NoLine Echo -------------
- "Noline Echo"
- LF = FALSE
- GOSUB "Echo"
- RETURN
- '
- ' ------------- Echo -------------
- "Echo"
- PRINT #Device, Temp$;
- IF LF THEN PRINT #Device, EOL$;
- LONG IF NOT Local
- PRINT Temp$;
- IF LF THEN PRINT
- END IF
- RETURN
- '
- ' ------------- Echo LF -------------
- "Echo LF"
- PRINT #Device, EOL$;
- IF NOT Local THEN PRINT
- RETURN
- '
- ' ------------- Read A Menu -------------
- ' Displays a menu and returns with valid command # in Command
- "Read A Menu"
- Reply = FALSE
- Execute = FALSE
- OPEN "I", 1, MenuFile$
- FOR Count% = 1 TO 3
- READ #1, Temp$;61
- TitleText$(Count%) = FN MakeStr$(Temp$)
- NEXT Count%
- IF UCASE$(TitleText$(1)) = "EXECUTE" THEN Execute = TRUE
- READ #1, Temp$;1
- CmdTotal = ASC(Temp$)
- FOR CmdCount = 1 TO CmdTotal
- READ #1, Temp$;1
- CmdType(CmdCount) = ASC(Temp$)
- READ #1, Temp$;61
- MenuText$(CmdCount) = FN MakeStr$(Temp$)
- READ #1, CmdKey$(CmdCount);1
- IF (CmdType(CmdCount) = 0) THEN CmdKey$(CmdCount) = CHR$(255)
- READ #1, Temp$;41
- CmdOpt$(CmdCount) = FN MakeStr$(Temp$)
- READ #1, Temp$;1
- CmdMod(CmdCount) = ASC(Temp$)
- READ #1, Temp$;1
- CmdClr(CmdCount) = ASC(Temp$)
- GOSUB "Check Clearance"
- LONG IF (NOT Clear)
- MenuText$(CmdCount) = ""
- CmdKey$(CmdCount) = CHR$(255)
- END IF
- READ #1, Temp$;1,Temp$;3
- GOSUB "Decode Restriction"
- Restrict&(CmdCount) = Temp&
- READ #1, Temp$;1
- CmdRMod(CmdCount) = ASC(Temp$)
- IF Clear THEN GOSUB "Check Restriction"
- LONG IF (NOT Clear)
- MenuText$(CmdCount) = ""
- CmdKey$(CmdCount) = CHR$(255)
- END IF
- NEXT CmdCount
- CLOSE #1
- IF Execute THEN "Execute Shortcut"
- "Show The Menu"
- ' Next section displays menu contents
- FOR Count% = 1 TO 3
- Temp$ = TitleText$(Count%)
- LONG IF NOT HotMenus
- GOSUB "Newline Echo"
- XELSE
- GOSUB "Display Menu"
- END IF
- IF Reply THEN Count% = 3
- NEXT Count%
- IF Reply THEN "Leave Read a Menu"
- FOR CmdCount = 1 TO CmdTotal
- Temp$ = MenuText$(CmdCount)
- LONG IF Temp$ > ""
- LONG IF NOT HotMenus
- GOSUB "Newline Echo"
- XELSE
- GOSUB "Display Menu"
- END IF
- END IF
- IF Reply THEN CmdCount = CmdTotal
- NEXT CmdCount
- IF Reply THEN "Leave Read a Menu"
- GOSUB "Echo LF"
- LONG IF ShowTime
- Now$ = TIME$
- Hour$ = LEFT$(Now$, 2)
- Minute$ = MID$(Now$, 4, 2)
- Now = (60 * VAL(Hour$)) + VAL(Minute$)
- Elapsed = Now - LogOnMinute
- ' Next line makes up for possible midnight boundary
- IF Elapsed < (-12 * 60) THEN Elapsed = Elapsed + (24 * 60)
- Remaining = ArchTime - Elapsed
- LONG IF Remaining < 0
- GOSUB "Echo LF"
- Temp$ = "Time limit expired!"
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- GOTO "Exit"
- END IF
- Temp = Remaining
- Place% = 0
- GOSUB "Format Number"
- IF Temp = 0 THEN Temp$ = "<1"
- Temp$ = "(" + Temp$ + " minutes left) "
- GOSUB "Noline Echo"
- END IF
- LONG IF ShowChoice
- Temp$ = "Command ("
- GOSUB "Noline Echo"
- Temp$ = ""
- FOR Count% = 1 TO CmdTotal
- LONG IF CmdKey$(Count%) <> CHR$(255)
- Temp$ = Temp$ + CmdKey$(Count%) + ","
- END IF
- NEXT Count%
- IF RIGHT$(Temp$, 1) = "," THEN Temp$ = LEFT$(Temp$, LEN(Temp$) -1)
- Temp$ = Temp$ + ") ? "
- GOSUB "Noline Echo"
- XELSE
- Temp$ = "Command? "
- GOSUB "Noline Echo"
- END IF
- "Menu Loop"
- IF HotMenus THEN NoShow = TRUE
- GOSUB "Get Reply"
- LONG IF HotMenus AND (Reply$ = CR$)
- GOSUB "Echo LF"
- GOTO "Show The Menu"
- END IF
- IF NOT HotMenus THEN Reply$ = RIGHT$(Reply$, 1)
- "Execute Shortcut"
- IF Execute = TRUE THEN Reply$ = "*"
- FOR CmdCount = 1 TO CmdTotal
- LONG IF Reply$ = CmdKey$(CmdCount)
- IF CmdType(CmdCount) > 0 THEN GOSUB "Check Clearance"
- LONG IF Clear
- LONG IF (HotMenus AND Execute = FALSE)
- Temp$ = Reply$
- GOSUB "Newline Echo"
- END IF
- Command = CmdType(CmdCount)
- Option$ = CmdOpt$(CmdCount)
- "Leave Read a Menu"
- RETURN
- END IF
- END IF
- NEXT CmdCount
- IF NOT HotMenus THEN "Show The Menu" ELSE "Menu Loop"
- '
- ' ------------- Display Menu -------------
- "Display Menu"
- Temp% = LEN(Temp$)
- FOR NewCount% = 1 TO Temp%
- Char$ = MID$(Temp$, NewCount%, 1)
- PRINT #Device, Char$;
- IF NOT Local THEN PRINT Char$;
- IF Local THEN Reply$ = INKEY$ ELSE READ #Port, Reply$;0
- LONG IF LEN(Reply$)
- Reply$ = UCASE$(Reply$)
- FOR CommandCount = 1 TO CmdTotal
- LONG IF Reply$ = CmdKey$(CommandCount)
- LONG IF CmdType(CommandCount) > 0
- GOSUB "Check Clearance"
- IF Clear THEN GOSUB "Check Restriction"
- END IF
- LONG IF Clear
- Temp$ = Reply$
- GOSUB "Newline Echo"
- Command = CmdType(CommandCount)
- Option$ = CmdOpt$(CommandCount)
- NewCount% = Temp% + 1
- Reply = TRUE
- CommandCount = CmdTotal
- NewCount% = Temp%
- END IF: REM >> IF Clearance OK <<
- END IF: REM >> IF Reply$ = CmdKey$() <<
- GOSUB "Check Modem"
- NEXT CommandCount
- END IF
- NEXT NewCount%
- GOSUB "Echo LF"
- RETURN
- '
- ' ------------- Check Clearance -------------
- "Check Clearance"
- Clear = FALSE
- LONG IF CmdMod(CmdCount) = 0
- IF ArchClearance => CmdClr(CmdCount) THEN Clear = TRUE
- XELSE
- LONG IF CmdMod(CmdCount) = 1
- IF ArchClearance =< CmdClr(CmdCount) THEN Clear = TRUE
- XELSE
- IF ArchClearance = CmdClr(CmdCount) THEN Clear = TRUE
- END IF
- END IF
- RETURN
- '
- ' ------------- Check Restriction -------------
- "Check Restriction"
- Clear = FALSE
- ' If CmdRMod(CmdCount) = 0 then user's restriction flags must exactly
- ' match menu's
- LONG IF CmdRMod(CmdCount) = 0
- Temp& = Restrict&(CmdCount) AND Restriction&
- IF Temp& = Restrict&(CmdCount) THEN Clear = TRUE
- '
- ' If CmdRMod(CmdCount) <> 0 then user's restriction flags must not
- ' match those set in menu command
- '
- XELSE
- Temp& = Restrict&(CmdCount) AND Restriction&
- IF Temp& = 0 THEN Clear = TRUE
- END IF
- RETURN
- '
- ' ------------- Get Caller's Speed & UserLog Offset -------------
- "Host Status"
- LONG IF MOUSE(3) <> 0
- ArchieLocal = TRUE
- MENU 1, 4, 0, "Hang up without update"
- GOSUB "No Launchfile"
- XELSE
- ArchieLocal = FALSE
- END IF
- ON ERROR GOSUB "Switch Launchfile"
- Temp$ = Host$
- GOSUB "Path Finder"
- "Try Again"
- Temp$ = HostPath$ + LaunchFile$
- OPEN "I", 1, Temp$, 69
- ON ERROR GOSUB "No Launchfile"
- READ #1, Temp$;4,Baud$;1,Temp$;3,LogOn$;6,Offset$;4
- READ #1, Temp$;4,Time$;1,Clearance$;1,Temp$;3,ReturnMenu$;41
- READ #1, Temp$;11,Restriction$;3
- CLOSE #1
- "Host Status Resume"
- Baud = ASC(Baud$)
- SELECT Baud
- CASE 0:Baud = 300:Baud$ = "(300)"
- CASE 1:Baud = 9600:Baud$ = "(9600)"
- CASE 2:Baud = 1200:Baud$ = "(1200)"
- CASE 3:Baud = 2400:Baud$ = "(2400)"
- CASE 4:Baud = 2400:Baud$ = "(Local)":Local = TRUE
- CASE 5:Baud =19200:Baud$ = "(19200)"
- END SELECT
- IF Baud < 300 THEN IF Baud > 0 THEN "Exit"
- ' We ignore bytes 1-3 and 6 of LogOn$ because we don't need 'em
- LogOnHour = ASC(MID$(LogOn$, 4, 1))
- LogOnMinute = ASC(MID$(LogOn$, 5, 1))
- LogOnMinute = LogOnMinute + (60 * LogOnHour)
- ArchTime = ASC(Time$)
- ArchClearance = ASC(Clearance$)
- ReturnMenu$ = FN MakeStr$(ReturnMenu$)
- Temp% = INSTR(1, ReturnMenu$, "{")
- LONG IF (Temp% > 0) AND (INSTR(Temp%, ReturnMenu$, "}") > 0)
- ArchieMenu$ = RIGHT$(ReturnMenu$, LEN(ReturnMenu$) - (Temp% - 1))
- XELSE
- Temp% = INSTR(1, ReturnMenu$, ";")
- LONG IF (Temp% > 0)
- ArchieMenu$ = RIGHT$(ReturnMenu$, (LEN(ReturnMenu$) - Temp%))
- TempLen = LEN(ArchieMenu$)
- DO
- Temp% = INSTR(1, ArchieMenu$, ";")
- MID$(ArchieMenu$, Temp%, 1) = ":"
- UNTIL Temp% = 0
- END IF
- END IF
- Temp$ = Restriction$
- GOSUB "Decode Restriction"
- Restriction& = Temp&
- RETURN
- '
- ' ------------- Decode Restriction -------------
- "Decode Restriction"
- ' Decodes three-byte restriction flag.
- ' Enter with Temp$, returns Temp&.
- ' Bytes are in MSB -> LSB order.
- Temp& = 0
- FOR Count% = 2 TO 0 STEP -1
- Temp& = ((ASC(MID$(Temp$, (3 - Count%), 1))) * 256^Count%) + Temp&
- NEXT Count%
- RETURN
- '
- ' ------------- Switch Launchfile -------------
- "Switch Launchfile"
- ERROR = 0
- ON ERROR GOSUB "No Launchfile"
- LaunchFile$ = "LaunchSS"
- RETURN "Try Again"
- '
- ' ------------- No Launchfile -------------
- "No Launchfile"
- ERROR = 0
- ON ERROR GOSUB "No Archie Run"
- LONG IF MOUSE(3) = 0
- Temp$ = HostPath$ + "Archie Run"
- OPEN "I", 1, Temp$
- CLOSE #1
- END IF
- Baud$ = CHR$(4)
- Temp$ = TIME$
- Hour$ = CHR$(VAL(MID$(Temp$, 1, 2)))
- Minute$ = CHR$(VAL(MID$(Temp$, 4, 2)))
- LogOn$ = STRING$(3, CHR$(0)) + Hour$ + Minute$
- Offset$ = STRING$(4, CHR$(0))
- OPEN "I", 1, UserLog$, 1
- GOSUB "Read UserLog Entry"
- CLOSE #1
- ReturnMenu$ = CHR$(10) + "Main Menu"
- RETURN "Host Status Resume"
- "No Archie Run"
- ERROR = 0
- BEEP
- PRINT
- PRINT "Archie must be run as a Command 50/51 application from Host. It"
- PRINT "cannot run as an application from the DeskTop. Check the RR Host"
- PRINT "and Archie documentation for more information."
- PRINT
- PRINT Exit$;
- DO
- UNTIL LEN(INKEY$)
- GOSUB "Desktop"
- '
- ' ------------- Who's On The BBS Now? -------------
- '
- ' This checks the Userlog offset contained in LaunchRRH, looks up the
- ' user in the UserLog, puts User's first & last name in caps/lower case
- ' and sets LineFeed variable to TRUE if caller needs linefeeds.
- '
- SEGMENT
- "User Status"
- GOSUB "Decode Offset"
- OPEN "I", 1, UserLog$, 1
- RECORD #1, Offset&
- GOSUB "Read UserLog Entry"
- CLOSE #1
- ArchCaller$ = Caller$
- Flag = ASC(Flag$)
- IF (NOT Local) AND (Flag AND 1) THEN LineFeed = TRUE ELSE LineFeed = FALSE
- IF Flag AND 2 THEN HowToClear = TRUE
- IF Flag AND 4 THEN HotMenus = FALSE ELSE HotMenus = TRUE
- IF Flag AND 128 THEN NoClear = TRUE
- Year% = ASC(MID$(LastCall$, 1, 1))
- Month% = ASC(MID$(LastCall$, 2, 1))
- Day% = ASC(MID$(LastCall$, 3, 1))
- GOSUB "Count the Days"
- ArchLastCall& = Day% + (Year% * 365.25)
- MyClearance = Clearance
- SEGMENT RETURN
- '
- ' ------------- Separate Path & Filename -------------
- "Path Finder"
- Temp = LEN (Temp$)
- FOR J = Temp TO 1 STEP -1
- Colon = INSTR(J, Temp$, ":")
- IF Colon THEN J = 0
- NEXT J
- FName$ = RIGHT$(Temp$, Temp - Colon)
- Temp$ = LEFT$(Temp$, Colon)
- RETURN
- '
- ' ------------- Hit Key to Continue -------------
- "Hit Key to Continue"
- GOSUB "Echo LF"
- GOSUB "Flush Keystrokes"
- Temp$ = Continue$
- GOSUB "Noline Echo"
- NoShow = TRUE
- GOSUB "Get A Key"
- RETURN
- '
- ' ------------- Flush Keystrokes -------------
- "Flush Keystrokes"
- DO
- IF NOT Local THEN READ #Port, Hit$;0 ELSE Hit$ = INKEY$
- UNTIL LEN(Hit$) < 1
- RETURN
- '
- ' ------------- Decode Offset -------------
- "Decode Offset"
- Offset& = 0
- FOR Count% = 1 TO 4
- Temp$ = MID$(Offset$, Count%, 1)
- Temp& = ASC(Temp$)
- Offset& = (Temp& * 256^(4 - Count%)) + Offset&
- NEXT Count%
- RETURN
- '
- ' ------------- Change ALL CAPS to Caps/Lower Case -------------
- "Initial Caps"
- L = LEN(Temp$)
- FOR Count% = 2 TO L
- A$ = MID$(Temp$, Count%, 1)
- A = ASC(A$)
- IF A > 64 THEN A = A + 32
- A$ = CHR$(A)
- MID$(Temp$, Count%, 1) = A$
- NEXT Count%
- RETURN
- '
- ' ------------- String Maker -------------
- "String Maker"
- Count$ = STR$(Count%)
- L = LEN(Count$)
- Count$ = RIGHT$(Count$, L-1)
- RETURN
- '
- ' ------------- Read UserLog Entry -------------
- "Read UserLog Entry"
- READ #1, Name1$;16, Name2$;16, From$;31, PW$;9, NoCalls$;2, LastCall$;6
- READ #1, Time$;1, Clearance$;1, Temp1$;3, Flag$;1
- READ #1, UL$;2, DL$;2, Priv$;2, Pub$;2, Junk$;3, Restriction$;3, Junk$;36
- Temp$ = FN MakeStr$(Name1$)
- GOSUB "Initial Caps"
- Name1$ = Temp$
- Temp$ = FN MakeStr$(Name2$)
- GOSUB "Initial Caps"
- Caller$ = Name1$ + " " + Temp$
- Temp$ = NoCalls$
- NoCalls = FN Short
- Time = ASC(Time$)
- Clearance = ASC(Clearance$)
- Temp$ = UL$
- UL = FN Short
- Temp$ = DL$
- DL = FN Short
- Temp$ = Priv$
- Priv = FN Short
- Temp$ = Pub$
- Pub = FN Short
- RETURN
- '
- ' ------------- Archie Information -------------
- "Archie Info"
- GOSUB "Echo LF"
- GOSUB "Echo LF"
- Temp$ = "Archie '89 "+Version$+" (" + When$ + ")"
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "Written by Pete Johnson"
- GOSUB "Newline Echo"
- Temp$ = "Dedicated to Abbey, the original Glassell Park Staff Dog"
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "Programmed in ZBasic. Portions copyright 1985-89 Zedcor, Inc."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = CHR$(34) + "Computers are useless. They can only give you answers." + CHR$(34)
- GOSUB "Newline Echo"
- Temp$ = " -- Pablo Picasso"
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "Thanks for visiting, " + ArchCaller$ + "."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = Continue$
- GOSUB "Noline Echo"
- GOSUB "Get A Key"
- IF Hit$ <> CR$ THEN GOSUB "Echo LF"
- RETURN
- '
- ' ------------- UserLog Password -------------
- "UserLog Password"
- LONG IF Option$ <> ""
- Password = FALSE
- GOSUB "Echo LF"
- Temp$ = "Please enter special UserLog viewing password: "
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- IF UCASE$(Reply$) = UCASE$(Option$) THEN Password = TRUE
- LONG IF (NOT Password)
- Temp$ = "Sorry, but that's not the right password."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- END IF
- XELSE
- Password = TRUE
- END IF
- RETURN
- '
- ' ------------- Get Archie Info -------------
- SEGMENT
- "Get Archie Info"
- ON ERROR GOSUB "No Info"
- ' Find out what Archie is called...
- CurApName = &H910
- CurApName$ = ""
- FOR Count% = 1 TO PEEK(CurApName)
- CurApName$ = CurApName$ + CHR$(PEEK(CurApName + Count%))
- NEXT Count%
- '
- ' Open Archie resource file
- Refnum = FN OPENRESFILE(CurApName$)
- GOSUB "Resource Error?"
- FOR Resource% = 130 TO 138
- SHndl& = FN GETNAMEDRESOURCE(CVI("STR "), ResName$(Resource%))
- LONG IF SHndl& = 0
- PRINT "No string available for STR ";Resource%;" (";ResName$(Resource%);")"
- XELSE
- SHndl& = FN GETSTRING(Resource%)
- Archie$(Resource%) = FN ReturnString$(SHndl&)
- END IF
- NEXT Resource%
- ArchieLogo& = FN GETPICTURE(500)
- Host$ = Archie$(130)
- OPEN "I", 1, Host$
- CLOSE #1
- IF ArchieMenu$ = "" THEN ArchieMenu$ = Archie$(131)
- OPEN "I", 1, ArchieMenu$
- CLOSE #1
- DLValue = VAL(Archie$(132))
- MsgValue! = VAL(Archie$(133))
- NewCall = VAL(Archie$(134))
- Privilege = VAL(Archie$(135))
- CheckDL = VAL(Archie$(136))
- CheckDL$ = Archie$(136)
- CheckUL = VAL(Archie$(137))
- CheckUL$ = Archie$(137)
- CheckMsg = VAL(Archie$(138))
- CheckMsg$ = Archie$(138)
- Temp$ = Host$
- GOSUB "Path Finder"
- HostPath$ = Temp$
- HostName$ = RIGHT$(Host$, (LEN(Host$) - LEN(HostPath$)))
- Temp$ = Archie$
- GOSUB "Path Finder"
- ArchiePath$ = Temp$
- Temp$ = HostPath$ + "Config"
- ON ERROR GOSUB "No Config"
- OPEN "I", 1, Temp$
- READ #1, Temp$;1
- IF ASC(Temp$) = 0 THEN PrintCallerLog = TRUE ELSE PrintCallerLog = FALSE
- IF ASC(Temp$) = 1 THEN CallerLog = TRUE ELSE CallerLog = FALSE
- IF ASC(Temp$) = 2 THEN CallerLog = TRUE:PrintCallerLog = TRUE
- READ #1, Temp$;11
- READ #1, Temp$;1
- Inactivity = 60 * ASC(Temp$)
- READ #1, Temp$;6
- READ #1, Temp$;1
- IF ASC(Temp$) = 1 THEN Port = -2 ELSE Port = -1
- IF Port = -2 THEN Modem = Modem + 1
- READ #1, Temp$;1
- IF ASC(Temp$) <> 0 THEN ShowTime = TRUE ELSE ShowTime = FALSE
- READ #1, Temp$;35, Temp$;1
- IF ASC(Temp$) <> 0 THEN ShowChoice = TRUE ELSE ShowChoice = FALSE
- READ #1, Temp$;41
- UserLog$ = FN MakeStr$(Temp$) + ":UserLog"
- READ #1, Temp$;41
- CallerLog$ = FN MakeStr$(Temp$) + ":CallerLog"
- READ #1, Junk$;177, Temp$;1
- MultiFinder = ASC(Temp$) : ' TRUE if non-zero, otherwise FALSE
- CLOSE #1
- SEGMENT RETURN
- '
- "No Info"
- ERROR = 0
- CLS
- PRINT
- PRINT "Archie doesn't recognize anything here. Please enter the Host"
- PRINT "program path and name so that Archie can go to work."
- PRINT
- Archie$(130) = ""
- LINE INPUT "Host name? ";Archie$(130)
- IF Archie$(130) = "" THEN "Desktop"
- PRINT
- PRINT "Now please enter the name of the main Archie Menu."
- PRINT
- Archie$(131) = ""
- LINE INPUT "Archie menu? ";Archie$(131)
- PRINT
- IF Archie$(131) = "" THEN "Desktop"
- Archie$(132) = "10"
- Archie$(133) = "5"
- Archie$(134) = "5"
- Archie$(135) = "200"
- Archie$(136) = "25"
- Archie$(137) = "1"
- Archie$(138) = "1"
- FOR Resource% = 130 TO 138
- SHndl& = FN GETRESOURCE(CVI("STR "), Resource%)
- CALL RMVERESOURCE(SHndl&)
- GOSUB "Resource Error?"
- SHndl& = FN NEWSTRING(Archie$(Resource%))
- CALL ADDRESOURCE(SHndl&, CVI("STR "), Resource%, ResName$(Resource%))
- GOSUB "Resource Error?"
- SHndl& = FN GETNAMEDRESOURCE(CVI("STR "), ResName$(Resource%))
- CALL WRITERESOURCE(SHndl&)
- GOSUB "Resource Error?"
- NEXT Resource%
- ON ERROR RETURN
- GOSUB "Desktop"
- '
- "No Config"
- ERROR = 0
- BEEP
- PRINT
- PRINT "There's a problem with the Config file! It's either missing or it"
- PRINT "is not properly set up."
- PRINT
- PRINT Exit$;
- DO
- UNTIL LEN(INKEY$)
- PRINT
- GOSUB "Desktop"
- '
- ' ------------- Resource Error? -------------
- "Resource Error?"
- Errnum = FN RESERROR
- LONG IF Errnum <> 0
- BEEP
- PRINT "Error #";Errnum
- PRINT "Problem with Archie resource file!"
- PRINT
- PRINT Continue$;
- DO
- UNTIL LEN(INKEY$)
- GOSUB "Desktop"
- END IF
- RETURN
- '
- ' ------------- Alter User Defaults -------------
- SEGMENT
- "Alter Default"
- GOSUB "Echo LF"
- Temp$ = "You can now alter Archie's default values."
- GOSUB "Newline Echo"
- Temp$ = "Archie needs seven answers:"
- GOSUB "Newline Echo"
- Temp$ = "<1> How many downloads are allowed per upload"
- GOSUB "Newline Echo"
- Temp$ = "<2> How many messages are equivalent to one upload"
- GOSUB "Newline Echo"
- Temp$ = "<3> Minimum number of calls to qualify (give new callers a break!)"
- GOSUB "Newline Echo"
- Temp$ = "<4> Privilege level (at or above this clearance level is ignored)"
- GOSUB "Newline Echo"
- Temp$ = "<5> Number of downloads to use in finding downloaders"
- GOSUB "Newline Echo"
- Temp$ = "<6> Number of uploads to exempt downloader from listing"
- GOSUB "Newline Echo"
- Temp$ = "<7> Number of public messages to exempt downloader from listing"
- GOSUB "Newline Echo"
- Temp$ = "For guidance, Archie's initial settings are 10, 5, 5, 200, 25, 1 and 1."
- GOSUB "Newline Echo"
- Temp$ = "The current setting is shown in <brackets>. To keep it, hit Return."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Archie$(130) = Host$
- Archie$(131) = ArchieMenu$
- Temp$ = "Downloads per upload <"+Archie$(132)+">? "
- GOSUB "Reply & Strip Spaces"
- LONG IF Reply$ <> ""
- Archie$(132) = Reply$
- DLValue = VAL(Reply$)
- END IF
- Temp$ = "Messages equal to one upload <"+Archie$(133)+">? "
- GOSUB "Reply & Strip Spaces"
- LONG IF Reply$ <> ""
- Archie$(133) = Reply$
- MsgValue! = VAL(Reply$)
- END IF
- Temp$ = "Minimum number of calls to qualify <"+Archie$(134)+">? "
- GOSUB "Reply & Strip Spaces"
- LONG IF Reply$ <> ""
- Archie$(134) = Reply$
- NewCall = VAL(Reply$)
- END IF
- Temp$ = "Privilege level <"+Archie$(135)+">? "
- GOSUB "Reply & Strip Spaces"
- LONG IF Reply$ <> ""
- Archie$(135) = Reply$
- Privilege = VAL(Reply$)
- END IF
- Temp$ = "Number of downloads to list <"+Archie$(136)+">? "
- GOSUB "Reply & Strip Spaces"
- LONG IF Reply$ <> ""
- Archie$(136) = Reply$
- CheckDL = VAL(Reply$)
- CheckDL$ = Reply$
- END IF
- Temp$ = "Number of uploads to exempt <"+Archie$(137)+">? "
- GOSUB "Reply & Strip Spaces"
- LONG IF Reply$ <> ""
- Archie$(137) = Reply$
- CheckUL = VAL(Reply$)
- CheckUL$ = Reply$
- END IF
- Temp$ = "Number of public messages to exempt <"+Archie$(138)+">? "
- GOSUB "Reply & Strip Spaces"
- LONG IF Reply$ <> ""
- Archie$(138) = Reply$
- CheckMsg = VAL(Reply$)
- CheckMsg$ = Reply$
- END IF
- FOR Resource% = 130 TO 138
- SHndl& = FN GETRESOURCE(CVI("STR "), Resource%)
- CALL RMVERESOURCE(SHndl&)
- GOSUB "Resource Error?"
- SHndl& = FN NEWSTRING(Archie$(Resource%))
- CALL ADDRESOURCE(SHndl&, CVI("STR "), Resource%, ResName$(Resource%))
- GOSUB "Resource Error?"
- SHndl& = FN GETRESOURCE(CVI("STR "), Resource%)
- CALL WRITERESOURCE(SHndl&)
- GOSUB "Resource Error?"
- NEXT Resource%
- SEGMENT RETURN
- '
- ' ------------- Reply & Strip Spaces -------------
- '
- "Reply & Strip Spaces"
- GOSUB "Noline Echo"
- GOSUB "Get A Line"
- LONG IF Reply$ <> ""
- Text$ = ""
- FOR Count% = 1 TO LEN(Reply$)
- Temp$ = MID$(Reply$, Count%, 1)
- IF Temp$ <> " " THEN Text$ = Text$ + Temp$
- NEXT Count%
- Reply$ = Text$
- END IF
- RETURN
- '
- ' ------------- Error Report -------------
- "Error Report"
- TheError$ = ERRMSG$(ERROR)
- Error = 0
- ON ERROR GOSUB "Argh!"
- OPEN "A", 2, "Archie Errorlog"
- PRINT #2, "*** Archie encountered an error on ";DATE$;" at ";TIME$
- PRINT #2, "*** The ZBasic error message is ";TheError$
- PRINT #2, "*** The current command is";Command
- PRINT #2, Dash$
- CLOSE #2
- RETURN
- '
- ' ------------- Exit Routines -------------
- "Launch App"
- ' -- Here's an exit
- GOSUB "Kill Pictures"
- GOSUB "Write to CallerLog"
- RUN Option$
- END: ' In case we come back here under MultiFinder
- '
- "No Update"
- GOSUB "Wipe LaunchRRH"
- GOSUB "Hang Up"
- "Exit"
- IF ERROR GOSUB "Error Report"
- ON ERROR GOSUB "Argh!"
- LONG IF Command = 102
- GOSUB "Wipe LaunchRRH"
- GOSUB "Hang Up"
- ' -- Here's an exit
- GOSUB "Kill Pictures"
- SHUTDOWN
- END IF
- "Change Menu"
- LONG IF Command = 99 AND ArchieLocal = FALSE
- Temp$ = HostPath$ + LaunchFile$
- OPEN "R", #1, Temp$, 1
- Temp$ = CHR$(LEN(Option$))
- Temp = LEN(Option$)
- RECORD #1, 27
- IF Temp < 41 THEN WRITE #1,Temp$;1,Option$;Temp
- CLOSE #1
- END IF
- "Back to Host"
- ' -- Here's an exit
- GOSUB "Kill Pictures"
- '
- IF NOT MultiFinder THEN RUN Host$ ELSE END
- '
- "Desktop"
- ' -- Here's an exit
- GOSUB "Kill Pictures"
- END
- "Argh!"
- ' -- Here's an exit
- GOSUB "Kill Pictures"
- SHUTDOWN
- '
- ' ------------- Wipe LaunchRRH -------------
- "Wipe LaunchRRH"
- LONG IF ArchieLocal = FALSE
- Temp$ = HostPath$ + LaunchFile$
- KILL Temp$
- '
- ' Next routine updates CallerLog if it's specified in Config file
- LONG IF CallerLog
- OPEN "A", 1, CallerLog$
- PRINT #1, "Logged off on ";DATE$;" at ";TIME$
- PRINT #1, Dash$
- CLOSE #1
- END IF
- '
- ' Next routine updates printed log if it's specified in Config file
- LONG IF PrintCallerLog
- OPEN "C", PPort, 9600
- HANDSHAKE PPort, -1
- PRINT #PPort, "Logged off on ";DATE$;" at ";TIME$
- PRINT #PPort, Dash$
- CLOSE #PPort
- END IF
- END IF
- RETURN
- '
- ' ------------- Hang Up -------------
- "Hang Up"
- GOSUB "Check Modem"
- LONG IF NOT Local
- GOSUB "Flush Keystrokes"
- DELAY 1250
- PRINT #Port, "+++";
- DELAY 1250
- PRINT #Port, "ATHS0=0"
- DELAY 500
- GOSUB "Flush Keystrokes"
- END IF
- RETURN
- '
- ' ------------- FSection Error -------------
- "FSection Error"
- TheError$ = ERRMSG$(ERROR)
- Error = 0
- ON ERROR GOSUB "Argh!"
- GOSUB "Echo LF"
- Temp$ = "Archie encountered an error while trying to read a file."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "The ZBasic error message is "+TheError$
- GOSUB "Newline Echo"
- Temp$ = "The current command is "+STR$(Command)
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "The following file could not be found:"
- GOSUB "Newline Echo"
- Temp$ = Option$
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = "Please check that you have the proper path and file name."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- Temp$ = Continue$
- GOSUB "Noline Echo"
- GOSUB "Get A Key"
- IF Hit$ <> CR$ THEN GOSUB "Echo LF"
- RETURN "FSec Closed"
- '
- ' ------------- Turn Menus On -------------
- "Turn Menus On"
- ' This next section enables menu functions every now and then
- MenuTimer = MenuTimer + 1
- LONG IF MenuTimer = 25
- MenuTimer = 1
- MENU ON
- MENU OFF
- END IF
- RETURN
- '
- ' ------------- Menu Event -------------
- "Menu Event"
- MenuBar = MENU(0)
- MenuItem = MENU(1)
- MENU
- LONG IF MenuBar = 255
- LONG IF MenuItem = 1
- WINDOW 4, "", (14, 57) - (248, 159), 3
- PICTURE(0,0), ArchieLogo&
- DO
- UNTIL MOUSE(3)
- WINDOW CLOSE #4
- END IF
- END IF
- LONG IF MenuBar = 1
- ' -- Here's an exit
- LONG IF MenuItem = 1
- GOSUB "Kill Pictures"
- CLOSE
- IF NOT MultiFinder THEN RUN Host$ ELSE END
- END IF
- LONG IF MenuItem = 2
- Answer$ = FILES$(1, "APPL",, V%)
- IF Answer$ = "" THEN "No Go"
- ' -- Here's an exit
- GOSUB "Kill Pictures"
- CLOSE
- RUN Answer$, V%
- END: ' In case we come back here under MultiFinder
- END IF
- ' -- Here's an exit
- LONG IF (MenuItem = 4) AND NOT ArchieLocal
- GOSUB "Kill Pictures"
- GOSUB "No Update"
- END IF
- ' -- Here's an exit
- LONG IF MenuItem = 5
- GOSUB "Kill Pictures"
- END
- END IF
- END IF
- LONG IF (MenuBar = 3)
- LONG IF (MenuItem = 1)
- ChatFlag = NOT ChatFlag
- LONG IF ChatFlag
- MENU 3, 1, 1, "End Chat"
- XELSE
- MENU 3, 1, 1, "Break in for Chat"
- END IF
- END IF
- END IF
- "No Go"
- MENU
- RETURN
- '
- ' ------------- Kill Pictures -------------
- "Kill Pictures"
- KILL PICTURE Pic1&
- KILL PICTURE Pic2&
- KILL PICTURE ArchieLogo&
- RETURN
- '
- ' ------------- Chat -------------
- '
- "Chat"
- GOSUB "Echo LF"
- GOSUB "Echo LF"
- Temp$ = "Sysop is breaking in to chat..."
- GOSUB "Newline Echo"
- GOSUB "Echo LF"
- WHILE ChatFlag
- GOSUB "Turn Menus On"
- Temp$ = INKEY$
- LONG IF LEN(Temp$)
- GOSUB "Noline Echo"
- XELSE
- LONG IF NOT Local
- READ #Port, Temp$;0
- IF LEN(Temp$) THEN GOSUB "Noline Echo"
- END IF
- END IF
- WEND
- GOSUB "Echo LF"
- TimeFlag = FALSE
- RETURN
- '
- ' ------------- Data -------------
- '
- DATA "Host/Second Sight Name", "Archie Menu", "DL Value", "Msg Value", "NewCaller"
- DATA "Privilege", "Check DL", "Check UL", "Check Msg"
-